fix(apply): check saveCoverLetter error; document cover-letter-generated in wrapper
This commit is contained in:
parent
ff84a4f02f
commit
eb0a12abef
2 changed files with 9 additions and 1 deletions
|
|
@ -288,12 +288,16 @@ async function generate() {
|
||||||
|
|
||||||
async function saveCoverLetter() {
|
async function saveCoverLetter() {
|
||||||
saving.value = true
|
saving.value = true
|
||||||
await useApiFetch(`/api/jobs/${props.jobId}/cover_letter`, {
|
const { error } = await useApiFetch(`/api/jobs/${props.jobId}/cover_letter`, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({ text: clText.value }),
|
body: JSON.stringify({ text: clText.value }),
|
||||||
})
|
})
|
||||||
saving.value = false
|
saving.value = false
|
||||||
|
if (error) {
|
||||||
|
showToast('Save failed — please try again')
|
||||||
|
return
|
||||||
|
}
|
||||||
isSaved.value = true
|
isSaved.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
|
<!--
|
||||||
|
@cover-letter-generated is intentionally not forwarded here.
|
||||||
|
The Marathon badge lives in ApplyView.vue (desktop split-pane only) — the full-page route is mobile-only.
|
||||||
|
-->
|
||||||
<ApplyWorkspace
|
<ApplyWorkspace
|
||||||
:job-id="jobId"
|
:job-id="jobId"
|
||||||
@job-removed="router.push('/apply')"
|
@job-removed="router.push('/apply')"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue