Merge pull request 'feat: refs #6403 add debug on cancel shipment' (!3197) from 6403-add-debug-on-cancelShipment into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #3197
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
Pablo Natek 2024-11-14 09:16:08 +00:00
commit b4406a69d8
1 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,9 @@ module.exports = Self => {
const xmlString = response.data; const xmlString = response.data;
const parser = new DOMParser(); const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xmlString, 'text/xml'); const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
await Self.rawSql('CALL util.debugAdd(?,?);', ['cancelShipment', xmlDoc]);
const result = xmlDoc.getElementsByTagName('Mensaje')[0].textContent; const result = xmlDoc.getElementsByTagName('Mensaje')[0].textContent;
return result.toLowerCase().includes('se ha cancelado correctamente'); return result.toLowerCase().includes('se ha cancelado correctamente');
}; };