From 3f2d7dc86f72441d9f075a80521871962c46e885 Mon Sep 17 00:00:00 2001 From: Sun Date: Thu, 14 Dec 2023 17:38:51 -0500 Subject: [PATCH] merge ready --- app/repository/references-repository.js | 2 +- app/services/references-service.js | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/repository/references-repository.js b/app/repository/references-repository.js index 1f90669e..d1ce302e 100644 --- a/app/repository/references-repository.js +++ b/app/repository/references-repository.js @@ -73,7 +73,7 @@ class ReferenceRepository { async create(data) { // Create the document - const reference = new Reference(data); + const reference = new this.model(data); // Save the document in the database try { diff --git a/app/services/references-service.js b/app/services/references-service.js index 30ce24b1..90c615da 100644 --- a/app/services/references-service.js +++ b/app/services/references-service.js @@ -9,19 +9,23 @@ class ReferencesService { } async retrieveAll(options) { - return this.repository.retrieveAll(options); + const res = await this.repository.retrieveAll(options); + return res; } async create(data) { - return this.repository.create(data); + const res = await this.repository.create(data); + return res; } async update(data) { - return this.repository.update(data); + const res = await this.repository.update(data); + return res; } async deleteBySourceName(sourceName) { - return this.repository.deleteBySourceName(sourceName); + const res = await this.repository.deleteBySourceName(sourceName); + return res; } }