Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6889-dropAddSaleByCode
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-05-20 12:34:37 +02:00
commit 40762ba4aa
2 changed files with 8 additions and 6 deletions

View File

@ -8,7 +8,8 @@
},
"properties": {
"id": {
"type": "string"
"type": "number",
"id": true
},
"originFk": {
"type": "number"

View File

@ -37,18 +37,19 @@ class Controller extends Section {
});
const filter = {
fields: ['originFk', 'creationDate', 'newInstance'],
fields: ['id', 'originFk', 'creationDate', 'newInstance'],
where: {
originFk: value,
newInstance: {like: '%"isDeleted":true%'}
},
order: 'creationDate DESC'
order: 'creationDate DESC',
limit: 1
};
this.$http.get(`TicketLogs/findOne`, {filter})
this.$http.get(`TicketLogs`, {filter})
.then(res => {
if (res && res.data) {
if (res && res.data && res.data.length) {
const now = Date.vnNew();
const maxDate = new Date(res.data.creationDate);
const maxDate = new Date(res.data[0].creationDate);
maxDate.setHours(maxDate.getHours() + 1);
if (now <= maxDate)
return this.canRestoreTicket = true;