import OrganisationProxy from '@mapcreator/api/src/proxy/OrganisationProxy.js'
OrganisationProxy
Extends:
Constructor Summary
Public Constructor | ||
public |
constructor(api: Mapcreator, parent: ResourceBase) |
Member Summary
Public Members | ||
public get |
parent: ResourceBase: * Returns parent instance |
Method Summary
Public Methods | ||
public |
attach(organisations: Array<Organisation|number>): CancelablePromise Attach organisations to the parent resource The provided organisations will be attached to the resource if they're not already attached |
|
public |
Attach all organisations to the parent resource |
|
public |
detach(organisations: Array<Organisation|number>): CancelablePromise Detach organisations from the parent resource The provided organisations will be detached from the resource |
|
public |
Detach all organisations from the parent resource |
|
public |
sync(organisations: Array<Organisation|number>): CancelablePromise Sync organisations to the parent resource The organisations attached to the target resource will be replaced with the organisations provided in the request. |
Protected Methods | ||
protected |
_modifyLink(items: Number, method: String, Type: Class<ResourceBase>, path: String): CancelablePromise Sync, attach or unlink resources |
Inherited Summary
From class SimpleResourceProxy | ||
public get |
Target: Class<ResourceBase>: * Target to wrap results in |
|
public get |
api: Mapcreator: * Get api instance |
|
public get |
Proxy target url |
|
public |
list(params: Number | Object | RequestParameters): CancelablePromise<PaginatedResourceListing> List target resource |
|
public |
lister(parameters: object | RequestParameters, maxRows: number): ResourceLister Get the resource lister |
|
public |
new(data: Object<String, *>): ResourceBase Build a new instance of the target |
Public Constructors
public constructor(api: Mapcreator, parent: ResourceBase) source
Override:
SimpleResourceProxy#constructorParams:
Name | Type | Attribute | Description |
api | Mapcreator | Instance of the api |
|
parent | ResourceBase | Parent instance |
Public Members
Public Methods
public attach(organisations: Array<Organisation|number>): CancelablePromise source
Attach organisations to the parent resource The provided organisations will be attached to the resource if they're not already attached
Params:
Name | Type | Attribute | Description |
organisations | Array<Organisation|number> | List of items to attach |
Throw:
If the api returns errors |
public attachAll(): CancelablePromise source
Attach all organisations to the parent resource
Throw:
If the api returns errors |
public detach(organisations: Array<Organisation|number>): CancelablePromise source
Detach organisations from the parent resource The provided organisations will be detached from the resource
Params:
Name | Type | Attribute | Description |
organisations | Array<Organisation|number> | List of items to detach |
Throw:
If the api returns errors |
public detachAll(): CancelablePromise source
Detach all organisations from the parent resource
Throw:
If the api returns errors |
public sync(organisations: Array<Organisation|number>): CancelablePromise source
Sync organisations to the parent resource The organisations attached to the target resource will be replaced with the organisations provided in the request.
Params:
Name | Type | Attribute | Description |
organisations | Array<Organisation|number> | List of items to sync |
Throw:
If the api returns errors |
Protected Methods
protected _modifyLink(items: Number, method: String, Type: Class<ResourceBase>, path: String): CancelablePromise source
Sync, attach or unlink resources
Params:
Name | Type | Attribute | Description |
items | Number | List of items to sync or attach |
|
method | String | Http method to use |
|
Type | Class<ResourceBase> | Resource type |
|
path | String |
|
Optional appended resource path, will guess if null |
Throw:
If the api returns errors |