Home Manual Reference Source Repository
import OrganisationProxy from '@mapcreator/api/src/proxy/OrganisationProxy.js'
public class | source

OrganisationProxy

Extends:

SimpleResourceProxy → OrganisationProxy

Constructor Summary

Public Constructor
public

constructor(api: Mapcreator, parent: ResourceBase)

Member Summary

Public Members
public get

Returns parent instance

Method Summary

Public Methods
public

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 from the parent resource The provided organisations will be detached from the resource

public

Detach all organisations from the parent resource

public

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 target resource

public

Get the resource lister

public

Build a new instance of the target

Public Constructors

public constructor(api: Mapcreator, parent: ResourceBase) source

Override:

SimpleResourceProxy#constructor

Params:

NameTypeAttributeDescription
api Mapcreator

Instance of the api

parent ResourceBase

Parent instance

Public Members

public get parent: ResourceBase: * source

Returns parent instance

Return:

ResourceBase

Parent instance

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:

NameTypeAttributeDescription
organisations Array<Organisation|number>

List of items to attach

Throw:

ApiError

If the api returns errors

public attachAll(): CancelablePromise source

Attach all organisations to the parent resource

Throw:

ApiError

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:

NameTypeAttributeDescription
organisations Array<Organisation|number>

List of items to detach

Throw:

ApiError

If the api returns errors

public detachAll(): CancelablePromise source

Detach all organisations from the parent resource

Throw:

ApiError

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:

NameTypeAttributeDescription
organisations Array<Organisation|number>

List of items to sync

Throw:

ApiError

If the api returns errors

Protected Methods

Sync, attach or unlink resources

Params:

NameTypeAttributeDescription
items Number

List of items to sync or attach

method String

Http method to use

Type Class<ResourceBase>

Resource type

path String
  • nullable: true

Optional appended resource path, will guess if null

Throw:

ApiError

If the api returns errors