Bug 33490: Prevent 400 on agreements?by_expired=true

We need to update the filter THEN update the current route

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-04-12 12:20:43 +02:00 committed by Tomas Cohen Arazi
parent 6f68b350ba
commit 90ed8a26c5
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 6 additions and 6 deletions

View File

@ -208,6 +208,12 @@ export default {
},
table_url: function () {
let url = "/api/v1/erm/agreements"
if (this.filters.by_expired) {
if (!this.filters.max_expiration_date)
this.filters.max_expiration_date = new Date()
.toISOString()
.substring(0, 10)
}
if (this.filters.by_expired)
url +=
"?max_expiration_date=" + this.filters.max_expiration_date
@ -221,12 +227,6 @@ export default {
)
this.$router.push(new_route)
}
if (this.filters.by_expired) {
if (!this.filters.max_expiration_date)
this.filters.max_expiration_date = new Date()
.toISOString()
.substring(0, 10)
}
this.$refs.table.redraw(this.table_url())
},
getTableColumns: function () {