Add kontakt_email to job offers

- New kontakt_email TEXT column on jobangebote (+ ALTER TABLE migration)
- Accept kontakt_email in POST /api/v1/joboffers (create + upsert) and
  document it in the OpenAPI spec
- Render a mailto: link on the /jobangebote page and include it in the
  curl example

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-03 22:16:55 +02:00
co-authored by Claude
parent faa3a45815
commit cb1115ef95
4 changed files with 19 additions and 5 deletions
+5 -3
View File
@@ -537,6 +537,7 @@ function createExternalApi(deps) {
const quelle = sanitizeInput(b.quelle || 'drittanbieter');
const externalId = b.external_id != null ? sanitizeInput(String(b.external_id)) : null;
const anzeigeDatum = sanitizeInput(b.anzeige_datum || '');
const kontaktEmail = sanitizeInput(b.kontakt_email || '');
const fields = [
sanitizeInput(b.firma),
sanitizeInput(b.stelle),
@@ -546,6 +547,7 @@ function createExternalApi(deps) {
sanitizeInput(b.quelle_url || ''),
sanitizeInput(b.art || ''),
anzeigeDatum,
kontaktEmail,
sanitizeInput(b.status || 'offen'),
];
@@ -558,7 +560,7 @@ function createExternalApi(deps) {
if (existing) {
await dbRun(
`UPDATE jobangebote SET firma = ?, stelle = ?, ort = ?, gehalt = ?,
beschreibung = ?, quelle_url = ?, art = ?, anzeige_datum = ?, status = ?,
beschreibung = ?, quelle_url = ?, art = ?, anzeige_datum = ?, kontakt_email = ?, status = ?,
updated_at = CURRENT_TIMESTAMP WHERE id = ?`,
[...fields, existing.id]
);
@@ -569,8 +571,8 @@ function createExternalApi(deps) {
const result = await dbRun(
`INSERT INTO jobangebote
(external_id, quelle, firma, stelle, ort, gehalt, beschreibung, quelle_url, art, anzeige_datum, status)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
(external_id, quelle, firma, stelle, ort, gehalt, beschreibung, quelle_url, art, anzeige_datum, kontakt_email, status)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
[externalId, quelle, ...fields]
);
const row = await dbGet('SELECT * FROM jobangebote WHERE id = ?', [result.lastID]);