From 9c5e1462739a8d30c56ed63b6192923ba5c804b5 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 14 Feb 2023 16:15:53 +0000 Subject: [PATCH] Bug 32939: Have a generic fetch function for POST and PUT requests in vue modules - Cleaned up the code and further extended the implementation concept on agreements only. - Jonathan I followed your suggestions but had to keep async/await or the catch will not work if an error is thrown from the http-client - I'm keeping this as a separate patch for diff check (intention is to squash all of it once we're happy) - I plan on continuing with this in coming days but more feedback is always welcome, also plan on rebasing this to 32925 Later: - api-client.js should be renamed to erm-api-client.js (or something of the sort) but I kept the same name for now for diff check - erm.js will ultimately disappear once this is all done (or api-client.js will become erm.js) --- .../components/ERM/AgreementRelationships.vue | 5 +- .../vue/components/ERM/AgreementsFormAdd.vue | 54 ++++----------- .../ERM/AgreementsFormConfirmDelete.vue | 44 +++++-------- .../js/vue/components/ERM/AgreementsList.vue | 5 +- .../js/vue/components/ERM/AgreementsShow.vue | 12 ++-- .../prog/js/vue/fetch/api-client.js | 43 +++++++++--- .../intranet-tmpl/prog/js/vue/fetch/erm.js | 22 +------ .../intranet-tmpl/prog/js/vue/fetch/fetch.js | 26 -------- .../prog/js/vue/fetch/http-client.js | 65 +++++++------------ 9 files changed, 103 insertions(+), 173 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/fetch/fetch.js diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementRelationships.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementRelationships.vue index 17bd31b784..241f065818 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementRelationships.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementRelationships.vue @@ -85,7 +85,7 @@