Home Reference Source
import {AssignmentService} from 'ceo-core/application/services/assignment-service.js'
public class | source

AssignmentService

Extends:

BaseService → AssignmentService

Interact with assignment API service

Method Summary

Public Methods
public

checkinAndFetch(assignmentId: string, lockId: string): *

Attempt to release a assignment lock, then update assignment store

public

Attempt to obtain a assignment lock, then update the assignment store

public

create(data: object, callback: Function): *

Create new assignment item

public

fetch(opts: object): *

Fetch paginated assignment items

public

fetchOne(id: string, opts: object, forceUpdate: Boolean): *

Fetch single assignment update

public

remove(id: string): *

Remove (delete) assignment item

public

search(opts: object): *

Run a query on the search endpoint.

public

update(id: string, data: object, callback: Function): *

Update existing assignment item

public

updateAssignment(assignment: *): *

public

updateAssignments(assignment: *): *

public

updatePagination(pagination: *): *

Inherited Summary

From class BaseService
public

Preform a DELETE action

public

get(url: string, params: object): object

Preform a GET action

public

post(url: string, data: object, params: object): object

Preform a POST action

public

postUpload(url: string, data: object, params: object): object

Preform a POST action

public

put(url: string, data: object): object

Preform a PUT action

Public Methods

public checkinAndFetch(assignmentId: string, lockId: string): * source

Attempt to release a assignment lock, then update assignment store

Params:

NameTypeAttributeDescription
assignmentId string

assignment UUID

lockId string

Lock UUID

Return:

*

public checkoutAndFetch(srn: string): * source

Attempt to obtain a assignment lock, then update the assignment store

Params:

NameTypeAttributeDescription
srn string

valid SRN

Return:

*

public create(data: object, callback: Function): * source

Create new assignment item

Params:

NameTypeAttributeDescription
data object

Hash of content data

callback Function

Return:

*

public fetch(opts: object): * source

Fetch paginated assignment items

Params:

NameTypeAttributeDescription
opts object

Hash of query options

Return:

*

public fetchOne(id: string, opts: object, forceUpdate: Boolean): * source

Fetch single assignment update

Params:

NameTypeAttributeDescription
id string

UUID

opts object

Hash of query options

forceUpdate Boolean

If true (default) force update to assignment store, otherwise, don't

Return:

*

public remove(id: string): * source

Remove (delete) assignment item

Params:

NameTypeAttributeDescription
id string

Return:

*

Run a query on the search endpoint. See search docs for query info

Params:

NameTypeAttributeDescription
opts object

Query has

Return:

*

public update(id: string, data: object, callback: Function): * source

Update existing assignment item

Params:

NameTypeAttributeDescription
id string

UUID

data object

Hash of assignment data

callback Function

Return:

*

public updateAssignment(assignment: *): * source

Params:

NameTypeAttributeDescription
assignment *

Return:

*

public updateAssignments(assignment: *): * source

Params:

NameTypeAttributeDescription
assignment *

Return:

*

public updatePagination(pagination: *): * source

Params:

NameTypeAttributeDescription
pagination *

Return:

*