Bugzilla – Attachment 147065 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 fetch agreements
Bug-32939-Use-APIClient-to-fetch-agreements.patch (text/plain), 4.42 KB, created by
Matt Blenkinsop
on 2023-02-21 16:15:33 UTC
(
hide
)
Description:
Bug 32939: Use APIClient to fetch agreements
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2023-02-21 16:15:33 UTC
Size:
4.42 KB
patch
obsolete
>From 70644ab3bfb60ce657766221723cb126f1257cc1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 21 Feb 2023 09:46:28 +0100 >Subject: [PATCH] Bug 32939: Use APIClient to fetch agreements > >Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >--- > .../components/ERM/AgreementRelationships.vue | 17 +++++++++++------ > .../js/vue/components/ERM/AgreementsList.vue | 4 ++-- > .../js/vue/components/ERM/AgreementsShow.vue | 4 ++-- > .../ERM/EHoldingsLocalPackageAgreements.vue | 14 +++++++++----- > 4 files changed, 24 insertions(+), 15 deletions(-) > >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 17bd31b7845..a2092bea2aa 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 @@ > </template> > > <script> >-import { fetchAgreements } from "../../fetch/erm.js" >+import { APIClient } from "../../fetch/api-client.js" > > export default { > data() { >@@ -94,11 +94,16 @@ export default { > } > }, > beforeCreate() { >- fetchAgreements().then(agreements => { >- this.agreements = agreements.filter( >- agreement => agreement.agreement_id !== this.agreement_id >- ) >- }) >+ const client = APIClient.erm >+ client.agreements.getAll().then( >+ agreements => { >+ this.agreements = agreements.filter( >+ agreement => agreement.agreement_id !== this.agreement_id >+ ) >+ this.initialized = true >+ }, >+ error => {} >+ ) > }, > methods: { > addRelationship() { >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >index f58b6814e25..9394f1c08d3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >@@ -95,8 +95,8 @@ export default { > async getAgreements() { > const client = APIClient.erm > await client.agreements.getAll().then( >- data => { >- this.agreements = data >+ agreements => { >+ this.agreements = agreements > this.initialized = true > }, > error => {} >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue >index b7ef04dbb28..b249bb8738f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue >@@ -348,8 +348,8 @@ export default { > async getAgreement(agreement_id) { > const client = APIClient.erm > client.agreements.get(agreement_id).then( >- data => { >- this.agreement = data >+ agreement => { >+ this.agreement = agreement > this.initialized = true > }, > error => {} >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageAgreements.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageAgreements.vue >index 80f5f98431e..e6330588062 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageAgreements.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackageAgreements.vue >@@ -55,7 +55,7 @@ > </template> > > <script> >-import { fetchAgreements } from "../../fetch/erm.js" >+import { APIClient } from "../../fetch/api-client.js" > > export default { > data() { >@@ -65,10 +65,14 @@ export default { > } > }, > beforeCreate() { >- fetchAgreements().then(agreements => { >- this.agreements = agreements >- this.initialized = true >- }) >+ const client = APIClient.erm >+ client.agreements.getAll().then( >+ agreements => { >+ this.agreements = agreements >+ this.initialized = true >+ }, >+ error => {} >+ ) > }, > methods: { > addAgreement() { >-- >2.37.1 (Apple Git-137.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