feat(salix): refs #6321 #6331 publish negativeOrigin model

This commit is contained in:
Javier Segarra 2024-04-22 14:09:27 +02:00
parent 5a5032f6e6
commit 68158f341d
3 changed files with 28 additions and 6 deletions

View File

@ -1,4 +1,3 @@
const {ParameterizedSQL} = require('loopback-connector');
module.exports = Self => { module.exports = Self => {
Self.remoteMethod('negativeOrigin', { Self.remoteMethod('negativeOrigin', {
@ -27,10 +26,7 @@ module.exports = Self => {
tx = await Self.beginTransaction({}); tx = await Self.beginTransaction({});
myOptions.transaction = tx; myOptions.transaction = tx;
} }
const conn = Self.dataSource.connector; const negativesOrigin = await Self.app.models.NegativeOrigin.find();
const stmts = ['SELECT * FROM vn.negativeOrigin']; return negativesOrigin;
const sql = ParameterizedSQL.join(stmts, ';');
const result = await conn.executeStmt(sql, myOptions);
return result;
}; };
}; };

View File

@ -35,6 +35,9 @@
"PackingSiteConfig": { "PackingSiteConfig": {
"dataSource": "vn" "dataSource": "vn"
}, },
"NegativeOrigin": {
"dataSource": "vn"
},
"ExpeditionMistake": { "ExpeditionMistake": {
"dataSource": "vn" "dataSource": "vn"
}, },

View File

@ -0,0 +1,23 @@
{
"name": "NegativeOrigin",
"base": "VnModel",
"options": {
"mysql": {
"table": "negativeOrigin"
}
},
"properties": {
"id": {
"id": true,
"type": "number",
"description": "Identifier"
}
},
"relations": {
"item": {
"type": "belongsTo",
"model": "Item",
"foreignKey": "itemFk"
}
}
}