import PlatformMenuService from 'clinical6/src/services/PlatformMenuService.js'
PlatformMenuService
Extends:
Service handling PlatformMenu calls with specific endpoints.
Constructor Summary
Public Constructor | ||
public |
Update type to be platformMenus |
Method Summary
Public Methods | ||
public |
async delete(platformMenu: PlatformMenu, cacheMode: String): Promise |
|
public |
async get(params: Object, cacheMode: String): Promise<PlatformMenu[]|PlatformMenu> |
|
public |
async insert(platformMenu: Object, cacheMode: String): Promise<PlatformMenu> |
|
public |
async update(platformMenu: PlatformMenu, cacheMode: String): Promise<PlatformMenu> |
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 delete(platformMenu: PlatformMenu, cacheMode: String): Promise source
Call a DELETE request on the main obj.type expecting JSON API information.
Override:
JsonApiService#deleteParams:
Name | Type | Attribute | Description |
platformMenu | PlatformMenu | PlatformMenu object in which to update |
|
cacheMode | String |
|
Override the caching method for this call |
Example:
import { platformMenuService } from 'clinical6';
// You will be able to delete a platformMenu using `delete`.
platformMenuService.delete({ id: 23 });
// This will also clear the local storage of this type and id
public async get(params: Object, cacheMode: String): Promise<PlatformMenu[]|PlatformMenu> source
Call a GET request expecting JSON API information.
Override:
JsonApiService#getReturn:
Promise<PlatformMenu[]|PlatformMenu> | Promise object that returns one platformMenu or a key:platformMenu hashtable |
Throw:
If missing token or missing required parameters |
Example:
import { platformMenuService } from 'clinical6';
// You will be able to access these platformMenus using the `get` method.
platformMenuService.get().then(platformMenus => console.log(platformMenus));
// Additionally, you can retrieve the subcategories for a specific platformMenu with the `get`
// method, using the ID of the desired platformMenu as a parameter.
platformMenuService.get({ id: 23 }).then(platformMenu => console.log(platformMenu));
public async insert(platformMenu: Object, cacheMode: String): Promise<PlatformMenu> source
Call a POST request on the main obj.type expecting JSON API information.
Override:
JsonApiService#insertExample:
import { PlatformMenu, platformMenuService } from 'clinical6';
const platformMenu = new PlatformMenu({...});
// you can insert a platformMenu using the `insert` method.
platformMenuService.insert(platformMenu).then(platformMenu => console.log(platformMenu));
// you could also just call `save` on the platformMenu if it doesn't have an id, which will also
// invoke the `insert` method
platformMenu.save();
public async update(platformMenu: PlatformMenu, cacheMode: String): Promise<PlatformMenu> source
Call a PATCH request on the main obj.type expecting JSON API information.
Override:
JsonApiService#updateParams:
Name | Type | Attribute | Description |
platformMenu | PlatformMenu | PlatformMenu object in which to update |
|
cacheMode | String |
|
Override the caching method for this call |
Example:
import { PlatformMenu, platformMenuService } from 'clinical6';
const platformMenu = new PlatformMenu({...});
// you can update a platformMenu using the `update` method.
platformMenuService.update(platformMenu).then(platformMenu => console.log(platformMenu));
// you could also just call `save` on the platformMenu if it has an id, which will also
// invoke the `update` method
platformMenu.save();