Bugzilla – Attachment 147043 Details for
Bug 32939
Have generic fetch functions in vue modules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32939: Use APIClient to replace some more fetch calls
Bug-32939-Use-APIClient-to-replace-some-more-fetch.patch (text/plain), 2.47 KB, created by
Jonathan Druart
on 2023-02-21 13:50:33 UTC
(
hide
)
Description:
Bug 32939: Use APIClient to replace some more fetch calls
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-02-21 13:50:33 UTC
Size:
2.47 KB
patch
obsolete
>From 0c3529ec372734bc4c16cdf0418abb6b9a164fea Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 21 Feb 2023 12:50:02 +0100 >Subject: [PATCH] Bug 32939: Use APIClient to replace some more fetch calls > >--- > .../EHoldingsLocalTitlesFormConfirmDelete.vue | 36 ++++++------------- > 1 file changed, 10 insertions(+), 26 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesFormConfirmDelete.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesFormConfirmDelete.vue >index d7206aec0bb..0e10e8eeadc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesFormConfirmDelete.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesFormConfirmDelete.vue >@@ -32,7 +32,7 @@ > > <script> > import { APIClient } from "../../fetch/api-client.js" >-import { setMessage, setError } from "../../messages" >+import { setMessage } from "../../messages" > > export default { > data() { >@@ -59,32 +59,16 @@ export default { > }, > onSubmit(e) { > e.preventDefault() >- >- let apiUrl = >- "/api/v1/erm/eholdings/local/titles/" + this.title.title_id >- >- const options = { >- method: "DELETE", >- headers: { >- "Content-Type": "application/json;charset=utf-8", >+ const client = APIClient.erm >+ client.localTitles.delete(this.title.title_id).then( >+ success => { >+ setMessage(this.$__("Title deleted")) >+ this.$router.push( >+ "/cgi-bin/koha/erm/eholdings/local/titles" >+ ) > }, >- } >- >- fetch(apiUrl, options) >- .then(response => checkError(response, 1)) >- .then(response => { >- if (response.status == 204) { >- setMessage(this.$__("Title deleted")) >- this.$router.push( >- "/cgi-bin/koha/erm/eholdings/local/titles" >- ) >- } else { >- setError(response.message || response.statusText) >- } >- }) >- .catch(error => { >- setError(error) >- }) >+ error => {} >+ ) > }, > }, > name: "EHoldingsLocalTitlesFormConfirmDelete", >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32939
:
146470
|
146509
|
146642
|
146644
|
146645
|
146668
|
146669
|
146670
|
146671
|
146672
|
146674
|
146675
|
146676
|
146677
|
146678
|
146679
|
146680
|
146681
|
146682
|
147029
|
147030
|
147031
|
147032
|
147033
|
147034
|
147035
|
147036
|
147037
|
147038
|
147039
|
147040
|
147041
|
147042
|
147043
|
147044
|
147056
|
147057
|
147059
|
147060
|
147061
|
147062
|
147063
|
147064
|
147065
|
147066
|
147067
|
147068
|
147069
|
147070
|
147071
|
147072
|
147073
|
147306
|
147307
|
147308
|
147309
|
147310
|
147311
|
147312
|
147313
|
147314
|
147315
|
147316
|
147317
|
147318
|
147319
|
147320
|
147321
|
147322
|
147332
|
149441