Choose enclosed attachments before generating; drop instant-generate
The generate form now lets the user pick which extra attachments (basis_anhaenge) to enclose — none selected by default. Only the chosen ones are attached, and their names are passed to the LLM so the cover letter's "Anlagen" list and wording reflect exactly what is enclosed. Job offers keep only "Als Bewerbung übernehmen" (draft first); the "Übernehmen & KI-Unterlagen" button and its route are removed. REST API: POST /applications/:id/generate accepts an optional `anlagen` array of attachment IDs (Swagger updated). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+6
-1
@@ -387,7 +387,12 @@ function createExternalApi(deps) {
|
||||
[id]
|
||||
);
|
||||
|
||||
runGeneration(id);
|
||||
// Optional: IDs of static attachments (basis_anhaenge) to enclose; none
|
||||
// by default. Also reflected in the cover letter's "Anlagen" list.
|
||||
const anlagenIds = Array.isArray((req.body || {}).anlagen)
|
||||
? req.body.anlagen.map((v) => parseInt(v, 10)).filter((n) => !Number.isNaN(n))
|
||||
: [];
|
||||
runGeneration(id, { anlagenIds });
|
||||
res.status(202).json({ success: true });
|
||||
} catch (error) {
|
||||
console.error('API generate error:', error);
|
||||
|
||||
Reference in New Issue
Block a user