Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanflorence committed Oct 22, 2023
1 parent 4b55a20 commit 0b20f2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/routes/board.$id/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export async function action({ request, params }: ActionFunctionArgs) {
let boardId = Number(params.id);
invariant(boardId, "Missing boardId");

let { intent, ...data } = await request.json();
let { intent, ...data } =
request.headers.get("Content-Type") === "application/json"
? await request.json()
: Object.fromEntries(await request.formData());

if (!intent) throw badRequest("Missing intent");

switch (intent) {
Expand Down

0 comments on commit 0b20f2e

Please sign in to comment.