Skip to content

Commit

Permalink
fix: redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
olros committed Apr 26, 2024
1 parent 6c362bc commit f4cfbf7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {

await trackCustomEvent(request, project);

return { ok: true };
return Response.json({ ok: true }, { status: 200 });
} catch (e) {
console.error('[API-Internal - Event]', e);
return Response.json({ ok: false }, { status: 400 });
Expand Down
2 changes: 1 addition & 1 deletion web/app/utils.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export const redirect = (response: LoaderFunctionArgs['response'], to: string):
response.headers.set('Location', to);
return response as never;
}
throw new Error("[redirect()] 'response' can't be null when using redirect");
return Response.redirect(to, 302) as never;
};

0 comments on commit f4cfbf7

Please sign in to comment.