refator: name endpoint
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-01-26 13:49:09 +01:00
parent 67127554f9
commit f7fa082294
4 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
UPDATE `vn`.`report`
SET `method`='InvoiceOuts/{refFk}/invoice'
SET `method`='InvoiceOuts/{refFk}/invoice-out-pdf'
WHERE name='invoice';
ALTER TABLE `vn`.`printQueue` MODIFY COLUMN printerFk tinyint(3) unsigned DEFAULT 82 NOT NULL;

View File

@ -2768,7 +2768,7 @@ INSERT INTO `salix`.`url` (`appName`, `environment`, `url`)
INSERT INTO `vn`.`report` (`id`, `name`, `paperSizeFk`, `method`)
VALUES
(3, 'invoice', NULL, 'InvoiceOuts/{refFk}/invoice');
(3, 'invoice', NULL, 'InvoiceOuts/{refFk}/invoice-out-pdf');
INSERT INTO `vn`.`payDemDetail` (`id`, `detail`)
VALUES

View File

@ -1,7 +1,7 @@
const {Report} = require('vn-print');
module.exports = Self => {
Self.remoteMethodCtx('invoicePdf', {
Self.remoteMethodCtx('invoiceOutPdf', {
description: 'Returns the invoice pdf',
accessType: 'READ',
accepts: [
@ -29,12 +29,12 @@ module.exports = Self => {
}
],
http: {
path: '/:reference/invoice',
path: '/:reference/invoice-out-pdf',
verb: 'GET'
}
});
Self.invoicePdf = async(ctx, reference) => {
Self.invoiceOutPdf = async(ctx, reference) => {
const args = Object.assign({}, ctx.args);
const params = {lang: ctx.req.getLocale()};

View File

@ -15,5 +15,5 @@ module.exports = Self => {
require('../methods/invoiceOut/exportationPdf')(Self);
require('../methods/invoiceOut/invoiceCsv')(Self);
require('../methods/invoiceOut/invoiceCsvEmail')(Self);
require('../methods/invoiceOut/invoicePdf')(Self);
require('../methods/invoiceOut/invoiceOutPdf')(Self);
};