Lines 198-203
import {
Link Here
|
198 |
submitted, |
198 |
submitted, |
199 |
} from "../../messages" |
199 |
} from "../../messages" |
200 |
import { fetchAgreement } from "../../fetch/erm.js" |
200 |
import { fetchAgreement } from "../../fetch/erm.js" |
|
|
201 |
import { submitToAPI } from "../../fetch/fetch.js" |
201 |
import { storeToRefs } from "pinia" |
202 |
import { storeToRefs } from "pinia" |
202 |
|
203 |
|
203 |
export default { |
204 |
export default { |
Lines 390-412
export default {
Link Here
|
390 |
}, |
391 |
}, |
391 |
} |
392 |
} |
392 |
|
393 |
|
393 |
isSubmitting() |
394 |
submitToAPI( |
394 |
fetch(apiUrl, options) |
395 |
{ |
395 |
.then(response => { |
396 |
apiUrl: apiUrl, |
396 |
if (response.status == 200) { |
397 |
options: options, |
397 |
this.$router.push("/cgi-bin/koha/erm/agreements") |
398 |
success_redirect: '/cgi-bin/koha/erm/agreements', |
398 |
setMessage(this.$__("Agreement updated")) |
399 |
created_message: this.$__("Agreement created"), |
399 |
} else if (response.status == 201) { |
400 |
updated_message: this.$__("Agreement updated"), |
400 |
this.$router.push("/cgi-bin/koha/erm/agreements") |
401 |
router: this.$router |
401 |
setMessage(this.$__("Agreement created")) |
402 |
} |
402 |
} else { |
403 |
) |
403 |
setError(response.message || response.statusText) |
|
|
404 |
} |
405 |
}) |
406 |
.catch(error => { |
407 |
setError(error) |
408 |
}) |
409 |
.then(() => submitted()) |
410 |
}, |
404 |
}, |
411 |
onStatusChanged(e) { |
405 |
onStatusChanged(e) { |
412 |
if (e.authorised_value != "closed") { |
406 |
if (e.authorised_value != "closed") { |