Skip to content

Commit

Permalink
Fixed empty displayOrder
Browse files Browse the repository at this point in the history
  • Loading branch information
pkirilin committed May 27, 2024
1 parent 437aaff commit 7bc4d25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/frontend/src/pages/pages/ui/Detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ export const action: ActionFunction = async ({ request, params }) => {
const pageId = Number(params.id);
const formData = await request.formData();
const mealType = formData.get('mealType')?.toString();
const displayOrder = formData.get('displayOrder')?.toString();
const photos = formData.getAll('photos');

if (!mealType || photos.length < 1) {
if (!mealType || !displayOrder || photos.length < 1) {
return redirect(`/pages/${pageId}`);
}

Expand All @@ -51,6 +52,7 @@ export const action: ActionFunction = async ({ request, params }) => {

const url = `/pages/${pageId}/notes/new/by-photo?${new URLSearchParams({
mealType,
displayOrder,
photoUrls,
}).toString()}`;

Expand Down

0 comments on commit 7bc4d25

Please sign in to comment.