feat: minor changes
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javi Gallego 2024-04-13 09:05:54 +02:00
parent bb6ea31bf7
commit e8001b72e4
3 changed files with 5 additions and 22 deletions

View File

@ -10,11 +10,6 @@ module.exports = Self => {
http: {
path: '/exchangeRateUpdate',
verb: 'post'
},
returns: {
arg: 'result',
type: 'object',
root: true
}
});
@ -29,16 +24,14 @@ module.exports = Self => {
const maxDateRecord = await models.ReferenceRate.findOne({order: 'dated DESC'});
const maxDate = maxDateRecord && maxDateRecord.dated ? new Date(maxDateRecord.dated) : null;
const maxDate = maxDateRecord?.dated ? new Date(maxDateRecord.dated) : null;
for (let i = 0; i < cubes.length; i++) {
const cube = cubes[i];
for (const cube of Array.from(cubes)) {
if (cube.nodeType === 1 && cube.attributes.getNamedItem('time')) {
const xmlDate = new Date(cube.getAttribute('time'));
const xmlDateWithoutTime = new Date(xmlDate.getFullYear(), xmlDate.getMonth(), xmlDate.getDate());
if (!maxDate || maxDate < xmlDateWithoutTime) {
for (let j = 0; j < cube.childNodes.length; j++) {
const rateCube = cube.childNodes[j];
for (const rateCube of Array.from(cube.childNodes)) {
if (rateCube.nodeType === doc.ELEMENT_NODE) {
const currencyCode = rateCube.getAttribute('currency');
const rate = rateCube.getAttribute('rate');

View File

@ -1,7 +1,6 @@
{
"name": "ReferenceRate",
"base": "PersistedModel",
"idInjection": false,
"options": {
"mysql": {
"table": "referenceRate"

View File

@ -352,14 +352,5 @@
"The line could not be marked": "La linea no puede ser marcada",
"This password can only be changed by the user themselves": "Esta contraseña solo puede ser modificada por el propio usuario",
"They're not your subordinate": "No es tu subordinado/a.",
"No results found": "No se han encontrado resultados",
"ReferenceError: app is not defined": "ReferenceError: app is not defined",
"TypeError: Cannot read properties of undefined (reading 'ReferenceRate')": "TypeError: Cannot read properties of undefined (reading 'ReferenceRate')",
"Error: ER_BAD_FIELD_ERROR: Unknown column 'date' in 'order clause'": "Error: ER_BAD_FIELD_ERROR: Unknown column 'date' in 'order clause'",
"ReferenceError: ReferenceRate is not defined": "ReferenceError: ReferenceRate is not defined",
"ValidationError: The `ReferenceRate` instance is not valid. Details: `currencyFk` can't be blank (value: NaN).": "ValidationError: The `ReferenceRate` instance is not valid. Details: `currencyFk` can't be blank (value: NaN).",
"ReferenceError: Currency is not defined": "ReferenceError: Currency is not defined",
"UserError: Currency not found for code: CNY": "UserError: Currency not found for code: CNY",
"Error: ER_DUP_ENTRY: Duplicate entry '2-2024-04-03' for key 'PRIMARY'": "Error: ER_DUP_ENTRY: Duplicate entry '2-2024-04-03' for key 'PRIMARY'",
"Error: ER_DUP_ENTRY: Duplicate entry '2-2024-04-08' for key 'PRIMARY'": "Error: ER_DUP_ENTRY: Duplicate entry '2-2024-04-08' for key 'PRIMARY'"
}
"No results found": "No se han encontrado resultados"
}