import OwnedResourceProxy from '@mapcreator/api/src/proxy/OwnedResourceProxy.js'
OwnedResourceProxy
Extends:
Used for proxying resource => organisation
Constructor Summary
Public Constructor | ||
public |
constructor(api: Mapcreator, parent: ResourceBase, Target: Class<ResourceBase>) OwnedResourceProxy Constructor |
Method Summary
Public Methods | ||
public |
attach(items: ResourceBase): CancelablePromise Attach items to the organisation |
|
public |
Attach parent resource to all organisations |
|
public |
detach(items: ResourceBase): CancelablePromise Detach items from the organisation |
|
public |
Detach parent resource to all organisations |
|
public |
sync(items: ResourceBase): CancelablePromise Sync items to the organisation |
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, Target: Class<ResourceBase>) source
OwnedResourceProxy Constructor
Override:
SimpleResourceProxy#constructorParams:
Name | Type | Attribute | Description |
api | Mapcreator | Api instance |
|
parent | ResourceBase | Parent instance |
|
Target | Class<ResourceBase> | Target constructor |
Public Methods
public attach(items: ResourceBase): CancelablePromise source
Attach items to the organisation
Params:
Name | Type | Attribute | Description |
items | ResourceBase | List of items to attach |
public attachAll(): CancelablePromise source
Attach parent resource to all organisations
Throw:
If the api returns errors |
public detach(items: ResourceBase): CancelablePromise source
Detach items from the organisation
Params:
Name | Type | Attribute | Description |
items | ResourceBase | List of items to unlink |
public detachAll(): CancelablePromise source
Detach parent resource to all organisations
Throw:
If the api returns errors |
public sync(items: ResourceBase): CancelablePromise source
Sync items to the organisation
Params:
Name | Type | Attribute | Description |
items | ResourceBase | List of items to sync |