From 3965968302ef5eabe128dc96d81365547859f2ad Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 17 Jun 2023 10:18:33 +0300 Subject: [PATCH] Enable v2_normalizeFormMethod --- app/features/tournament/routes/to.$id.tsx | 2 +- app/routes/plus/suggestions.tsx | 2 +- remix.config.js | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/features/tournament/routes/to.$id.tsx b/app/features/tournament/routes/to.$id.tsx index da9ed6717..d79f181be 100644 --- a/app/features/tournament/routes/to.$id.tsx +++ b/app/features/tournament/routes/to.$id.tsx @@ -30,7 +30,7 @@ import { findOwnTeam } from "../queries/findOwnTeam.server"; import { findSubsByTournamentId } from "~/features/tournament-subs"; export const shouldRevalidate: ShouldRevalidateFunction = (args) => { - const wasMutation = args.formMethod === "post"; + const wasMutation = args.formMethod === "POST"; const wasOnMatchPage = args.formAction?.includes("matches"); if (wasMutation && wasOnMatchPage) { diff --git a/app/routes/plus/suggestions.tsx b/app/routes/plus/suggestions.tsx index d90516d0f..7be53e2d4 100644 --- a/app/routes/plus/suggestions.tsx +++ b/app/routes/plus/suggestions.tsx @@ -143,7 +143,7 @@ export interface PlusSuggestionsLoaderData { export const shouldRevalidate: ShouldRevalidateFunction = ({ formMethod }) => { // only reload if form submission not when user changes tabs - return Boolean(formMethod && formMethod !== "get"); + return Boolean(formMethod && formMethod !== "GET"); }; export const loader: LoaderFunction = async ({ request }) => { diff --git a/remix.config.js b/remix.config.js index 3dab1734d..0872a9239 100644 --- a/remix.config.js +++ b/remix.config.js @@ -98,5 +98,6 @@ module.exports = { serverModuleFormat: "cjs", future: { v2_meta: true, + v2_normalizeFormMethod: true, }, };