From fb382329b863f120fb3bf4214f4f1ea64c0d37f8 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 25 Jun 2020 22:43:10 +0100 Subject: [PATCH] lint :sparkles: --- packages/builder/src/builderStore/store/backend.js | 3 +-- packages/server/src/api/controllers/model.js | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/builderStore/store/backend.js b/packages/builder/src/builderStore/store/backend.js index 4015cd6279..7f156e8c39 100644 --- a/packages/builder/src/builderStore/store/backend.js +++ b/packages/builder/src/builderStore/store/backend.js @@ -1,7 +1,6 @@ import { writable } from "svelte/store" import { cloneDeep } from "lodash/fp" import api from "../api" -import { update } from "lodash" export const getBackendUiStore = () => { const INITIAL_BACKEND_UI_STATE = { @@ -82,7 +81,7 @@ export const getBackendUiStore = () => { } const SAVE_MODEL_URL = `/api/models` - console.log(updatedModel); + console.log(updatedModel) const response = await api.post(SAVE_MODEL_URL, updatedModel) const savedModel = await response.json() await store.actions.models.fetch() diff --git a/packages/server/src/api/controllers/model.js b/packages/server/src/api/controllers/model.js index 58b7f65811..36dd9730e5 100644 --- a/packages/server/src/api/controllers/model.js +++ b/packages/server/src/api/controllers/model.js @@ -24,12 +24,12 @@ exports.save = async function(ctx) { ...ctx.request.body, } - // update renamed record fields when model is updated + // update renamed record fields when model is updated const { _rename } = modelToSave if (_rename) { const records = await db.query(`database/all_${modelToSave._id}`, { - include_docs: true - }); + include_docs: true, + }) const docs = records.rows.map(({ doc }) => { doc[_rename.updated] = doc[_rename.old] delete doc[_rename.old] @@ -55,7 +55,7 @@ exports.save = async function(ctx) { modelId: modelToSave._id, constraints: { type: "array", - } + }, } await db.put(linkedModel) }