fix(apply): check saveCoverLetter error; document cover-letter-generated in wrapper

This commit is contained in:
pyr0ball 2026-03-19 08:36:19 -07:00
parent ff84a4f02f
commit eb0a12abef
2 changed files with 9 additions and 1 deletions

View file

@ -288,12 +288,16 @@ async function generate() {
async function saveCoverLetter() {
saving.value = true
await useApiFetch(`/api/jobs/${props.jobId}/cover_letter`, {
const { error } = await useApiFetch(`/api/jobs/${props.jobId}/cover_letter`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: clText.value }),
})
saving.value = false
if (error) {
showToast('Save failed — please try again')
return
}
isSaved.value = true
}

View file

@ -1,4 +1,8 @@
<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
:job-id="jobId"
@job-removed="router.push('/apply')"