diff --git a/db/versions/11206-turquoiseCyca/00-firstScript.sql b/db/versions/11206-turquoiseCyca/00-firstScript.sql index c1d63fcec..ab6b35a0f 100644 --- a/db/versions/11206-turquoiseCyca/00-firstScript.sql +++ b/db/versions/11206-turquoiseCyca/00-firstScript.sql @@ -1,2 +1,2 @@ -INSERT INTO salix.ACL (model,property,principalId) +INSERT IGNORE INTO salix.ACL (model,property,principalId) VALUES ('Entry','getBuysCsv','supplier'); diff --git a/modules/entry/back/methods/entry/getBuysCsv.js b/modules/entry/back/methods/entry/getBuysCsv.js index 76b9cdc57..541179a1d 100644 --- a/modules/entry/back/methods/entry/getBuysCsv.js +++ b/modules/entry/back/methods/entry/getBuysCsv.js @@ -2,8 +2,8 @@ const UserError = require('vn-loopback/util/user-error'); const {toCSV} = require('vn-loopback/util/csv'); module.exports = Self => { - Self.remoteMethodCtx('getBuys', { - description: 'Returns buys for one entry', + Self.remoteMethodCtx('getBuysCsv', { + description: 'Returns buys for one entry in CSV file format', accessType: 'READ', accepts: [{ arg: 'id', @@ -34,7 +34,7 @@ module.exports = Self => { } }); - Self.getBuys = async(ctx, id, options) => { + Self.getBuysCsv = async(ctx, id, options) => { const userId = ctx.req.accessToken.userId; const models = Self.app.models; const myOptions = {};