Redirect to event page after reporting winners

This commit is contained in:
Kalle 2022-08-12 23:00:59 +03:00
parent 8269288cb2
commit d45db1527a
2 changed files with 10 additions and 4 deletions

View File

@ -23,8 +23,8 @@ Calendar
## Other
- [ ] Refactor Avatar to accept player object instead of separate fields
- [ ] Redirect to event page after submitting results
- [ ] can submit results with one invalid linked user
- [x] Redirect to event page after submitting results
- [x] date input take in account time zone difference between server and client
- [x] User selector allow passing users from top level
- [x] Constants use CALENDAR_EVENT object

View File

@ -1,4 +1,9 @@
import { type ActionFunction, type LoaderArgs, json } from "@remix-run/node";
import {
type ActionFunction,
type LoaderArgs,
json,
redirect,
} from "@remix-run/node";
import { Form, useLoaderData } from "@remix-run/react";
import { z } from "zod";
import { Label } from "~/components/Label";
@ -22,6 +27,7 @@ import { FormMessage } from "~/components/FormMessage";
import { FormErrors } from "~/components/FormErrors";
import type { UseDataFunctionReturn } from "@remix-run/react/dist/components";
import type { Unpacked } from "~/utils/types";
import { calendarEventPage } from "~/utils/urls";
const playersSchema = z
.array(
@ -114,7 +120,7 @@ export const action: ActionFunction = async ({ request, params }) => {
})),
});
return null;
return redirect(calendarEventPage(parsedParams.id));
};
export const handle = {