TemporaryIdService
Extends:
Service handling TemporaryId calls with specific endpoints.
Constructor Summary
Public Constructor | ||
public |
Update type to be temporaryIds |
Method Summary
Public Methods | ||
public |
async get(temporaryId: Object, cacheMode: String): Promise<TemporaryId> |
|
public |
async insert(temporaryId: Object, cacheMode: String): Promise<TemporaryId> |
Inherited Summary
From class AbstractService | ||
public get |
|
|
public set |
|
|
public |
|
|
private |
|
From class JsonApiService | ||
public |
options: * |
|
public |
Call a DELETE request on the main obj.type expecting JSON API information. |
|
public |
Call a GET request expecting JSON API information. |
|
public |
async getChildren(parent: Object, child: Object, options: String): Promise Call a GET request expecting JSON API information for children given a parent. |
|
public |
Call a POST request on the main obj.type expecting JSON API information. |
|
public |
Call a PATCH request on the main obj.type expecting JSON API information. |
Public Constructors
Public Methods
public async get(temporaryId: Object, cacheMode: String): Promise<TemporaryId> source
Call a GET request expecting JSON API information.
Override:
JsonApiService#getThrow:
If missing token or missing required parameters |
Example:
import { temporaryIdService } from 'clinical6';
// You will be able to access the temporary identifier data and associated user using the `get` method.
temporaryIdService.get().then(temporaryId => console.log(temporaryId));
// You can retrieve the temporary identifier data and associated user using `get`
// method, using the temporary identifier token as a parameter.
temporaryIdService.get(temporaryId).then(temporaryId => console.log(temporaryId));
public async insert(temporaryId: Object, cacheMode: String): Promise<TemporaryId> source
Call a POST request on the main obj.type expecting JSON API information.
Override:
JsonApiService#insertExample:
import { TemporaryId, temporaryIdService } from 'clinical6';
const temporaryId = new TemporaryId({...});
// you can insert a temporaryId using the `insert` method.
temporaryIdService.insert(temporaryId).then(temporaryId => console.log(temporaryId));
// you could also just call `save` on the temporaryId if it doesn't have an id, which will also
// invoke the `insert` method
temporaryId.save();