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:
+5
-3
@@ -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]);
|
||||
|
||||
@@ -785,6 +785,7 @@ function buildOpenApiSpec(baseUrl = '') {
|
||||
quelle_url: { type: 'string', nullable: true },
|
||||
art: { type: 'string', nullable: true },
|
||||
anzeige_datum: { type: 'string', format: 'date', nullable: true, description: 'Datum der eigentlichen Stellenanzeige (vom Drittanbieter übergeben)' },
|
||||
kontakt_email: { type: 'string', format: 'email', nullable: true, description: 'Kontakt-E-Mail-Adresse der Stelle' },
|
||||
status: { type: 'string', enum: ['offen', 'uebernommen', 'abgelehnt'] },
|
||||
verknuepfte_bewerbung_id: { type: 'integer', nullable: true },
|
||||
created_at: { type: 'string', format: 'date-time' },
|
||||
@@ -805,6 +806,7 @@ function buildOpenApiSpec(baseUrl = '') {
|
||||
quelle_url: { type: 'string' },
|
||||
art: { type: 'string', enum: ART_OPTIONS },
|
||||
anzeige_datum: { type: 'string', format: 'date', description: 'Datum der eigentlichen Stellenanzeige (ISO YYYY-MM-DD)' },
|
||||
kontakt_email: { type: 'string', format: 'email', description: 'Kontakt-E-Mail-Adresse der Stelle' },
|
||||
status: { type: 'string', enum: ['offen', 'uebernommen', 'abgelehnt'], default: 'offen' },
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user