Bug 32939: Uniformize api calls
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 15 Feb 2023 10:38:08 +0000 (11:38 +0100)
committerMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Tue, 28 Feb 2023 19:01:30 +0000 (19:01 +0000)
commit36d83c93265ddb6468ed7de300a2c9442e339adb
treef8e6302f0d222829545d047bac24c23a220bb126
parent5399301c9f3482f1b196a4b8cf09b7988736841c
Bug 32939: Uniformize api calls

We want to make the call easier and without less errors possible.
Here, no need to async keyword, try-catch, etc.
Only call the method and use the common then with the 2 success and
error Promise arguments.

We will certainly want to add later a parameter to prevent the display
of the error in fetchJSON, in case the failure does not require a message
for the end user.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 545e568b9f243d3347ee7770f752e23d0af851ac)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormConfirmDelete.vue
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue
koha-tmpl/intranet-tmpl/prog/js/vue/fetch/http-client.js