Keep generated role selection server-owned

This commit is contained in:
Meta Vens 2026-08-18 23:17:11 +02:00
commit 4995f261f6
5 changed files with 391 additions and 27 deletions

View file

@ -252,8 +252,8 @@ document.querySelector<HTMLFormElement>("#suggest-form")!.addEventListener("subm
event.preventDefault();
const result = await compilerPost("/api/compiler/openings", { setting: document.querySelector<HTMLInputElement>("#setting")!.value, constraints: [] });
showCards(result.openings, "Choose opening", async opening => {
const roles = await compilerPost("/api/compiler/roles", opening);
showCards(roles.roles, "Choose role", async role => showPreview(await compilerPost("/api/compiler/selected", { campaign_name: opening.title, opening, role })));
const roles = await compilerPost("/api/compiler/roles", { opening_id: opening.id });
showCards(roles.roles, "Choose role", async role => showPreview(await compilerPost("/api/compiler/selected", { campaign_name: opening.title, opening_id: opening.id, role_id: role.id })));
});
});