Manual Reference Source Test
import PlatformMenuService from 'clinical6/src/services/PlatformMenuService.js'
public class | source

PlatformMenuService

Extends:

AbstractServiceJsonApiService → PlatformMenuService

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

async delete(obj: Object, options: String): Promise

Call a DELETE request on the main obj.type expecting JSON API information.

public

async get(params: Object, options: String): Promise

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

async insert(obj: Object, options: String): Promise

Call a POST request on the main obj.type expecting JSON API information.

public

async update(obj: Object, options: String): Promise

Call a PATCH request on the main obj.type expecting JSON API information.

Public Constructors

public constructor() source

Update type to be platformMenus

Override:

JsonApiService#constructor

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#delete

Params:

NameTypeAttributeDescription
platformMenu PlatformMenu

PlatformMenu object in which to update

cacheMode String
  • optional

Override the caching method for this call

Return:

Promise

Message

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

Test:

public async get(params: Object, cacheMode: String): Promise<PlatformMenu[]|PlatformMenu> source

Call a GET request expecting JSON API information.

Override:

JsonApiService#get

Params:

NameTypeAttributeDescription
params Object
  • optional

Parameters used to get information from server (such as id)

params.id Number
  • optional

Id of the platformMenu

cacheMode String
  • optional

Override the caching method for this call

Return:

Promise<PlatformMenu[]|PlatformMenu>

Promise object that returns one platformMenu or a key:platformMenu hashtable

Throw:

Clinical6Error

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));

Test:

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#insert

Params:

NameTypeAttributeDescription
platformMenu Object
  • optional

Parameters used to get information from server (such as id)

cacheMode String
  • optional

Override the caching method for this call

Return:

Promise<PlatformMenu>

Inserted platformMenu

Example:

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();

Test:

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#update

Params:

NameTypeAttributeDescription
platformMenu PlatformMenu

PlatformMenu object in which to update

cacheMode String
  • optional

Override the caching method for this call

Return:

Promise<PlatformMenu>

Updated platformMenu

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();

Test: