From 36d33f166bbdb387028c1f643b6cc4718c37c03c Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 27 Jul 2022 15:53:54 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=BD=A6=E8=BE=86=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/data/vehicle.js | 6 +++--- api/log/development.log | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/api/app/lib/controllers/data/vehicle.js b/api/app/lib/controllers/data/vehicle.js index 4a607072..1cae9b49 100644 --- a/api/app/lib/controllers/data/vehicle.js +++ b/api/app/lib/controllers/data/vehicle.js @@ -115,9 +115,9 @@ async function specificEdit (ctx) { const data = ctx.request.body; if (!data.vehicleId) { - const vehicleRes = await models.Vehicle.create(data) + const vehicleRes = await models.MunicipalVehicle.create(data) } else { - const vehicleRes = await models.Vehicle.update(data, { + const vehicleRes = await models.MunicipalVehicle.update(data, { where: { id: data.vehicleId } @@ -139,7 +139,7 @@ async function specificDel (ctx) { const models = ctx.fs.dc.models; const { vehicleId } = ctx.params; - const vehicleRes = await models.Vehicle.destroy({ + const vehicleRes = await models.MunicipalVehicle.destroy({ where: { id: vehicleId } diff --git a/api/log/development.log b/api/log/development.log index 405078ef..2999be3e 100644 --- a/api/log/development.log +++ b/api/log/development.log @@ -9999,3 +9999,12 @@ 2022-07-27 14:42:45.566 - info: [FS-ATTACHMENT] Inject attachment mw into router. 2022-07-27 14:42:45.566 - info: [FS-AUTH] Inject auth and api mv into router. 2022-07-27 14:42:48.376 - error: path: /data/export, error: ReferenceError: fs is not defined +2022-07-27 15:29:53.136 - debug: [FS-LOGGER] Init. +2022-07-27 15:29:53.285 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2022-07-27 15:29:53.285 - info: [FS-AUTH] Inject auth and api mv into router. +2022-07-27 15:47:39.653 - error: path: /vehicle/1/specific, error: TypeError: Cannot read property 'destroy' of undefined +2022-07-27 15:47:55.412 - error: path: /vehicle/1/specific, error: TypeError: Cannot read property 'destroy' of undefined +2022-07-27 15:48:01.737 - error: path: /vehicle/4/specific, error: TypeError: Cannot read property 'destroy' of undefined +2022-07-27 15:49:28.071 - error: path: /vehicle/3/specific, error: TypeError: Cannot read property 'destroy' of undefined +2022-07-27 15:50:36.847 - error: path: /vehicle/3/specific, error: TypeError: Cannot read property 'destroy' of undefined +2022-07-27 15:51:05.608 - error: path: /vehicle/3/specific, error: TypeError: Cannot read property 'destroy' of undefined