From afa677190392d48715930ebe2b1e15c7619d730f Mon Sep 17 00:00:00 2001 From: vicente1992 Date: Tue, 6 Dec 2022 15:48:25 -0500 Subject: [PATCH] fix(adapter): corrections are made to the adapter --- packages/database/src/json-file/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/database/src/json-file/index.js b/packages/database/src/json-file/index.js index b75c077..af53df8 100644 --- a/packages/database/src/json-file/index.js +++ b/packages/database/src/json-file/index.js @@ -1,6 +1,8 @@ -const Path = require('path') +const path = require('path') const StormDB = require('stormdb') -const engine = new StormDB.localFileEngine(Path.join(__dirname, './db.stormdb')) +const engine = new StormDB.localFileEngine( + path.join(process.cwd(), './db.stormdb') +) class JsonFileAdapter { db @@ -30,14 +32,13 @@ class JsonFileAdapter { return { ...result, - options: JSON.parse(result.options), } } save = async (ctx) => { await this.db .get('history') - .push({ ...ctx, options: JSON.stringify(ctx.options) }) + .push({ ...ctx }) .save() console.log('Guardado en DB...', ctx) this.listHistory.push(ctx)