From 4819f89b43c3525aa97d23bf69a995f50773fbf5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 6 Apr 2023 16:23:41 +0200 Subject: [PATCH] Bug 30708: Show the copy button right after the train is received Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: BULAC - http://www.bulac.fr/ Signed-off-by: Heather Hernandez Signed-off-by: Laurence Rault Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- .../js/vue/components/Preservation/TrainsShow.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue index 1ee9dfdb84..978b08986c 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue @@ -343,11 +343,11 @@ export default { train[attribute] = new Date() const client = APIClient.preservation if (train_id) { - client.trains + return client.trains .update(train, train_id) .then(() => this.getTrain(this.train.train_id)) } else { - client.trains + return client.trains .create(train) .then(() => this.getTrain(this.train.train_id)) } @@ -359,7 +359,16 @@ export default { this.updateTrainDate("sent_on") }, receiveTrain() { - this.updateTrainDate("received_on") + this.updateTrainDate("received_on").then( + success => { + // Rebuild the table to show the "copy" button + $("#" + this.table_id) + .DataTable() + .destroy() + this.build_datatable() + }, + error => {} + ) }, editItem(train_item_id) { this.$router.push( -- 2.39.5