Skip to main content

Class: NoteService

Hierarchy

  • "medusa-interfaces"

    NoteService

Constructors

constructor

new NoteService(__namedParameters)

Parameters

NameType
__namedParametersObject

Overrides

BaseService.constructor

Defined in

services/note.js:12

Properties

Events

Static Events: Object

Type declaration

NameType
CREATEDstring
DELETEDstring
UPDATEDstring

Defined in

services/note.js:6

Methods

create

create(data, config?): Promise<any>

Creates a note associated with a given author

Parameters

NameTypeDescription
dataCreateNoteInputthe note to create
configanyany configurations if needed, including meta data

Returns

Promise<any>

resolves to the creation result

Defined in

services/note.js:98


delete

delete(noteId): Promise<any>

Deletes a given note

Parameters

NameTypeDescription
noteIdanyid of the note to delete

Returns

Promise<any>

Defined in

services/note.js:154


list

list(selector, config?): Promise<Note[]>

Fetches all notes related to the given selector

Parameters

NameTypeDescription
selectoranythe query object for find
configObjectthe configuration used to find the objects. contains relations, skip, and take.
config.relationsstring[]Which relations to include in the resulting list of Notes.
config.skipnumberHow many Notes to skip in the resulting list of Notes.
config.takenumberHow many Notes to take in the resulting list of Notes.

Returns

Promise<Note[]>

notes related to the given search.

Defined in

services/note.js:77


retrieve

retrieve(id, config?): Promise<Note>

Retrieves a specific note.

Parameters

NameTypeDescription
idstringthe id of the note to retrieve.
configanyany options needed to query for the result.

Returns

Promise<Note>

which resolves to the requested note.

Defined in

services/note.js:51


update

update(noteId, value): Promise<any>

Updates a given note with a new value

Parameters

NameTypeDescription
noteIdanythe id of the note to update
valueanythe new value

Returns

Promise<any>

resolves to the updated element

Defined in

services/note.js:131


withTransaction

withTransaction(transactionManager): NoteService

Sets the service's manager to a given transaction manager

Parameters

NameTypeDescription
transactionManagerEntityManagerthe manager to use

Returns

NoteService

a cloned note service

Defined in

services/note.js:30