Skip to content

Commit 1d16cee

Browse files
Update app/actions/revalidateChat.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent bb695a3 commit 1d16cee

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/actions/revalidateChat.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ export async function revalidateChatAction(
1010
) {
1111
chatId = z.uuid().parse(chatId);
1212
if (typeof pagePath === "string") {
13-
if (!/^[a-z0-9-_]+\/[a-z0-9-_]+$/.test(pagePath)) {
13+
if (!/^[a-z0-9_-]+\/[a-z0-9_-]+$/.test(pagePath)) {
1414
throw new Error("Invalid pagePath format");
1515
}
16-
const [lang, page] = pagePath.split("/") as [LangId, PageSlug];
17-
pagePath = { lang, page };
16+
const [lang, page] = pagePath.split("/");
17+
pagePath = PagePathSchema.parse({ lang, page });
1818
} else {
1919
pagePath = PagePathSchema.parse(pagePath);
2020
}

0 commit comments

Comments
 (0)