Lines 254-267
export default {
Link Here
|
254 |
methods: { |
254 |
methods: { |
255 |
async getAgreement(agreement_id) { |
255 |
async getAgreement(agreement_id) { |
256 |
const client = APIClient.erm |
256 |
const client = APIClient.erm |
257 |
try { |
257 |
client.agreements.get(agreement_id).then( |
258 |
await client.agreements.get(agreement_id).then(data => { |
258 |
data => { |
259 |
this.agreement = data |
259 |
this.agreement = data |
260 |
this.initialized = true |
260 |
this.initialized = true |
261 |
}) |
261 |
}, |
262 |
} catch (err) { |
262 |
error => {} |
263 |
setError(err.message || err.statusText) |
263 |
) |
264 |
} |
|
|
265 |
}, |
264 |
}, |
266 |
checkForm(agreement) { |
265 |
checkForm(agreement) { |
267 |
let errors = [] |
266 |
let errors = [] |
Lines 376-397
export default {
Link Here
|
376 |
delete agreement.agreement_packages |
375 |
delete agreement.agreement_packages |
377 |
|
376 |
|
378 |
const client = APIClient.erm |
377 |
const client = APIClient.erm |
379 |
;(async () => { |
378 |
if (agreement_id) { |
380 |
try { |
379 |
client.agreements.update(agreement, agreement_id).then( |
381 |
if (agreement_id) { |
380 |
success => { |
382 |
await client.agreements |
381 |
setMessage(this.$__("Agreement updated")) |
383 |
.update(agreement, agreement_id) |
382 |
this.$router.push("/cgi-bin/koha/erm/agreements") |
384 |
.then(setMessage(this.$__("Agreement updated"))) |
383 |
}, |
385 |
} else { |
384 |
error => {} |
386 |
await client.agreements |
385 |
) |
387 |
.create(agreement) |
386 |
} else { |
388 |
.then(setMessage(this.$__("Agreement created"))) |
387 |
client.agreements.create(agreement).then( |
389 |
} |
388 |
success => { |
390 |
this.$router.push("/cgi-bin/koha/erm/agreements") |
389 |
setMessage(this.$__("Agreement created")) |
391 |
} catch (err) { |
390 |
this.$router.push("/cgi-bin/koha/erm/agreements") |
392 |
setError(err.message || err.statusText) |
391 |
}, |
393 |
} |
392 |
error => {} |
394 |
})() |
393 |
) |
|
|
394 |
} |
395 |
}, |
395 |
}, |
396 |
onStatusChanged(e) { |
396 |
onStatusChanged(e) { |
397 |
if (e.authorised_value != "closed") { |
397 |
if (e.authorised_value != "closed") { |