View | Details | Raw Unified | Return to bug 32939
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormAdd.vue (-3 / +3 lines)
Lines 190-196 import AgreementLicenses from "./AgreementLicenses.vue" Link Here
190
import AgreementRelationships from "./AgreementRelationships.vue"
190
import AgreementRelationships from "./AgreementRelationships.vue"
191
import Documents from "./Documents.vue"
191
import Documents from "./Documents.vue"
192
import { setMessage, setError, setWarning } from "../../messages"
192
import { setMessage, setError, setWarning } from "../../messages"
193
import { ERMAPIClient } from "../../fetch/erm-api-client.js"
193
import { APIClient } from "../../fetch/api-client.js"
194
import { storeToRefs } from "pinia"
194
import { storeToRefs } from "pinia"
195
195
196
export default {
196
export default {
Lines 253-259 export default { Link Here
253
    },
253
    },
254
    methods: {
254
    methods: {
255
        async getAgreement(agreement_id) {
255
        async getAgreement(agreement_id) {
256
            const client = new ERMAPIClient()
256
            const client = APIClient.erm
257
            try {
257
            try {
258
                await client.agreements.get(agreement_id).then(data => {
258
                await client.agreements.get(agreement_id).then(data => {
259
                    this.agreement = data
259
                    this.agreement = data
Lines 375-381 export default { Link Here
375
375
376
            delete agreement.agreement_packages
376
            delete agreement.agreement_packages
377
377
378
            const client = new ERMAPIClient()
378
            const client = APIClient.erm
379
            ;(async () => {
379
            ;(async () => {
380
                try {
380
                try {
381
                    if (agreement_id) {
381
                    if (agreement_id) {
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsFormConfirmDelete.vue (-3 / +3 lines)
Lines 36-42 Link Here
36
</template>
36
</template>
37
37
38
<script>
38
<script>
39
import { ERMAPIClient } from "../../fetch/erm-api-client.js"
39
import { APIClient } from "../../fetch/api-client.js"
40
import { setMessage, setError } from "../../messages"
40
import { setMessage, setError } from "../../messages"
41
41
42
export default {
42
export default {
Lines 53-59 export default { Link Here
53
    },
53
    },
54
    methods: {
54
    methods: {
55
        async getAgreement(agreement_id) {
55
        async getAgreement(agreement_id) {
56
            const client = new ERMAPIClient()
56
            const client = APIClient.erm
57
            try {
57
            try {
58
                await client.agreements.get(agreement_id).then(data => {
58
                await client.agreements.get(agreement_id).then(data => {
59
                    this.agreement = data
59
                    this.agreement = data
Lines 66-72 export default { Link Here
66
        onSubmit(e) {
66
        onSubmit(e) {
67
            e.preventDefault()
67
            e.preventDefault()
68
68
69
            const client = new ERMAPIClient()
69
            const client = APIClient.erm
70
            ;(async () => {
70
            ;(async () => {
71
                try {
71
                try {
72
                    await client.agreements
72
                    await client.agreements
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue (-2 / +2 lines)
Lines 37-43 Link Here
37
import flatPickr from "vue-flatpickr-component"
37
import flatPickr from "vue-flatpickr-component"
38
import Toolbar from "./AgreementsToolbar.vue"
38
import Toolbar from "./AgreementsToolbar.vue"
39
import { inject, createVNode, render } from "vue"
39
import { inject, createVNode, render } from "vue"
40
import { ERMAPIClient } from "../../fetch/erm-api-client.js"
40
import { APIClient } from "../../fetch/api-client.js"
41
import { storeToRefs } from "pinia"
41
import { storeToRefs } from "pinia"
42
import { useDataTable, build_url } from "../../composables/datatables"
42
import { useDataTable, build_url } from "../../composables/datatables"
43
43
Lines 93-99 export default { Link Here
93
    },
93
    },
94
    methods: {
94
    methods: {
95
        async getAgreements() {
95
        async getAgreements() {
96
            const client = new ERMAPIClient()
96
            const client = APIClient.erm
97
            const agreements = await client.agreements.getAll()
97
            const agreements = await client.agreements.getAll()
98
            this.agreements = agreements
98
            this.agreements = agreements
99
            this.initialized = true
99
            this.initialized = true
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue (-2 / +2 lines)
Lines 300-306 Link Here
300
300
301
<script>
301
<script>
302
import { inject } from "vue"
302
import { inject } from "vue"
303
import { ERMAPIClient } from "../../fetch/erm-api-client.js"
303
import { APIClient } from "../../fetch/api-client.js"
304
import { setError } from "../../messages"
304
import { setError } from "../../messages"
305
305
306
export default {
306
export default {
Lines 347-353 export default { Link Here
347
    },
347
    },
348
    methods: {
348
    methods: {
349
        async getAgreement(agreement_id) {
349
        async getAgreement(agreement_id) {
350
            const client = new ERMAPIClient()
350
            const client = APIClient.erm
351
            try {
351
            try {
352
                await client.agreements.get(agreement_id).then(data => {
352
                await client.agreements.get(agreement_id).then(data => {
353
                    this.agreement = data
353
                    this.agreement = data
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/api-client.js (+5 lines)
Line 0 Link Here
1
import ERMAPIClient from "./erm-api-client";
2
3
export const APIClient = {
4
    erm: new ERMAPIClient(),
5
};
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/erm-api-client.js (-2 / +1 lines)
Lines 43-46 export class ERMAPIClient extends HttpClient { Link Here
43
    }
43
    }
44
}
44
}
45
45
46
export default ERMAPIClient;
46
export default ERMAPIClient;
47
- 

Return to bug 32939