fix: make packages/medusa/src/services/note.js pass eslint (#565)

This commit is contained in:
Abdullah Pathan
2021-10-17 15:34:02 -04:00
committed by GitHub
parent f2c3251771
commit 275a0f1d57
2 changed files with 7 additions and 9 deletions
-1
View File
@@ -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
+7 -8
View File
@@ -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)