diff --git a/.eslintignore b/.eslintignore index efd4a28e6a..e0062240ca 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,7 +7,6 @@ /packages/medusa/src/services/idempotency-key.js /packages/medusa/src/services/inventory.js /packages/medusa/src/services/middleware.js -/packages/medusa/src/services/note.js /packages/medusa/src/services/oauth.js /packages/medusa/src/services/payment-provider.js /packages/medusa/src/services/product-collection.js diff --git a/packages/medusa/src/services/note.js b/packages/medusa/src/services/note.js index 25d032803f..65d11bff2a 100644 --- a/packages/medusa/src/services/note.js +++ b/packages/medusa/src/services/note.js @@ -1,6 +1,5 @@ import { MedusaError } from "medusa-core-utils" import { BaseService } from "medusa-interfaces" -import _ from "lodash" import { TransactionManager } from "typeorm" class NoteService extends BaseService { @@ -47,7 +46,7 @@ class NoteService extends BaseService { * Retrieves a specific note. * @param {*} id - the id of the note to retrieve. * @param {*} config - any options needed to query for the result. - * @returns {Promise} which resolves to the requested note. + * @return {Promise} which resolves to the requested note. */ async retrieve(id, config = {}) { const noteRepo = this.manager_.getCustomRepository(this.noteRepository_) @@ -91,14 +90,14 @@ class NoteService extends BaseService { * Creates a note associated with a given author * @param {object} data - the note to create * @param {*} config - any configurations if needed, including meta data - * @returns {Promise} resolves to the creation result + * @return {Promise} resolves to the creation result */ async create(data, config = { metadata: {} }) { const { metadata } = config const { resource_id, resource_type, value, author_id } = data - return this.atomicPhase_(async manager => { + return this.atomicPhase_(async (manager) => { const noteRepo = manager.getCustomRepository(this.noteRepository_) const toCreate = { @@ -124,10 +123,10 @@ class NoteService extends BaseService { * Updates a given note with a new value * @param {*} noteId - the id of the note to update * @param {*} value - the new value - * @returns {Promise} resolves to the updated element + * @return {Promise} resolves to the updated element */ async update(noteId, value) { - return this.atomicPhase_(async manager => { + return this.atomicPhase_(async (manager) => { const noteRepo = manager.getCustomRepository(this.noteRepository_) const note = await this.retrieve(noteId, { relations: ["author"] }) @@ -147,10 +146,10 @@ class NoteService extends BaseService { /** * Deletes a given note * @param {*} noteId - id of the note to delete - * @returns {Promise} + * @return {Promise} */ async delete(noteId) { - return this.atomicPhase_(async manager => { + return this.atomicPhase_(async (manager) => { const noteRepo = manager.getCustomRepository(this.noteRepository_) const note = await this.retrieve(noteId)