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 <heather_hernandez@nps.gov>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-04-06 16:23:41 +02:00 committed by Tomas Cohen Arazi
parent 2f1b35ea56
commit 4819f89b43
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 12 additions and 3 deletions

View File

@ -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(