From 76f808e7f6c3ae4ae3711073b3dc7f9c5befbcad Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Thu, 8 Feb 2018 11:40:06 +0100 Subject: [PATCH] itemLog for item history refactor --- services/item/common/methods/item/getLog.js | 4 +- services/item/common/models/itemLog.json | 60 ++++++++++----------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/services/item/common/methods/item/getLog.js b/services/item/common/methods/item/getLog.js index 3c0c1e413..eb74fac5b 100644 --- a/services/item/common/methods/item/getLog.js +++ b/services/item/common/methods/item/getLog.js @@ -4,12 +4,12 @@ module.exports = Self => { function filterParams(params) { return { where: { - itemFk: params.itemFk + originFk: params.itemFk }, skip: (params.page - 1) * params.size, limit: params.size, include: [{ - relation: "origin" + relation: "item" }, { relation: "user" diff --git a/services/item/common/models/itemLog.json b/services/item/common/models/itemLog.json index 60a105dff..d17294a0c 100644 --- a/services/item/common/models/itemLog.json +++ b/services/item/common/models/itemLog.json @@ -1,35 +1,35 @@ { - "name": "ItemLog", - "base": "VnModel", - "options": { - "mysql": { - "table": "itemLog", - "database": "vn" - } - }, - "properties": { - "id": { - "type": "Number", - "id": true, - "description": "Identifier" - }, - "creationDate": { - "type": "Date" - }, - "description": { - "type": "String" + "name": "ItemLog", + "base": "VnModel", + "options": { + "mysql": { + "table": "itemLog", + "database": "vn" } + }, + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" }, - "relations": { - "origin": { - "type": "belongsTo", - "model": "Origin", - "foreignKey": "originFk" - }, - "user": { - "type": "belongsTo", - "model": "User", - "foreignKey": "userFk" - } + "creationDate": { + "type": "Date" + }, + "description": { + "type": "String" } + }, + "relations": { + "item": { + "type": "belongsTo", + "model": "Item", + "foreignKey": "originFk" + }, + "user": { + "type": "belongsTo", + "model": "User", + "foreignKey": "userFk" + } } +}