refs #4734 recator: cambiado nombre ruta
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2023-06-16 13:49:21 +02:00
parent 2da54ac3d7
commit 998597dfcc
5 changed files with 11 additions and 14 deletions

View File

@ -1,7 +1,7 @@
const axios = require('axios');
module.exports = Self => {
Self.remoteMethod('putExpedicionInternacional', {
Self.remoteMethod('internationalExpedition', {
description: 'Returns the lastest campaigns',
accessType: 'WRITE',
accepts: [{
@ -14,19 +14,20 @@ module.exports = Self => {
root: true
},
http: {
path: `/putExpedicionInternacional`,
path: `/internationalExpedition`,
verb: 'POST'
}
});
Self.putExpedicionInternacional = async(expeditionFk, options) => {
Self.internationalExpedition = async(expeditionFk, options) => {
const myOptions = {};
if (typeof options == 'object')
Object.assign(myOptions, options);
const [data] = await Self.rawSql(`
SELECT urlAccess,
SELECT
url,
clientViaexpress,
userViaexpress,
passwordViaexpress,
@ -113,9 +114,8 @@ module.exports = Self => {
</soap12:Body>
</soap12:Envelope>`;
const url = 'http://82.223.6.71:82/ServicioVxClientes.asmx';
try {
const response = await axios.post(url, xmlData, {
const response = await axios.post(`${data.url}ServicioVxClientes.asmx`, xmlData, {
headers: {
'Content-Type': 'application/soap+xml; charset=utf-8'
}

View File

@ -1,3 +1,3 @@
module.exports = Self => {
require('../methods/viaexpress-config/putExpedicionInternacional')(Self);
require('../methods/viaexpress-config/internationalExpedition')(Self);
};

View File

@ -11,7 +11,7 @@
"type": "number",
"required": true
},
"urlAccess": {
"url": {
"type": "string",
"required": true
},

View File

@ -1,3 +1,3 @@
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
VALUES
('ViaexpressConfig', 'putExpedicionInternacional', 'WRITE', 'ALLOW', 'ROLE', 'employee');
('ViaexpressConfig', 'internationalExpedition', 'WRITE', 'ALLOW', 'ROLE', 'employee');

View File

@ -1,13 +1,10 @@
CREATE TABLE `vn`.`viaexpressConfig` (
id int auto_increment NOT NULL,
urlAccess varchar(100) NOT NULL,
url varchar(100) NOT NULL,
clientViaexpress varchar(100) NOT NULL,
userViaexpress varchar(100) NOT NULL,
passwordViaexpress varchar(100) NOT NULL,
defaultWeight decimal(10,2) NOT NULL,
deliveryType varchar(5) NOT NULL,
CONSTRAINT viaexpressConfig_PK PRIMARY KEY (id)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb3
COLLATE=utf8mb3_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;