Skip to content

Commit

Permalink
Prøver å fikse feil ved oppdatering av aktivitetsstatus.
Browse files Browse the repository at this point in the history
  • Loading branch information
sstensby committed Nov 15, 2023
1 parent 135b9a9 commit 28eeeac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Aktiviteter/status-klient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const oppdaterStatus = async (
`forebygge-fravar/api/aktivitet/${aktivitetId}/orgnr/${orgnr}/oppdater`,
{
method: "POST",
body: JSON.stringify({ status }),
body: JSON.stringify({ status, aktivitetstype: "OPPGAVE" }),
headers: {
"Content-Type": "application/json",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ export default async function handler(
const { aktivitetId, orgnr } = req.query;
const { status } = req.body;

if (req.method !== "POST") {
return res.status(405).json({ error: "Method Not Allowed" });
}

if (typeof aktivitetId !== "string") {
return res.status(400).json({ error: "Mangler 'aktivitetId' i path" });
}
Expand Down

0 comments on commit 28eeeac

Please sign in to comment.