We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb695a3 commit 1d16ceeCopy full SHA for 1d16cee
1 file changed
app/actions/revalidateChat.ts
@@ -10,11 +10,11 @@ export async function revalidateChatAction(
10
) {
11
chatId = z.uuid().parse(chatId);
12
if (typeof pagePath === "string") {
13
- if (!/^[a-z0-9-_]+\/[a-z0-9-_]+$/.test(pagePath)) {
+ if (!/^[a-z0-9_-]+\/[a-z0-9_-]+$/.test(pagePath)) {
14
throw new Error("Invalid pagePath format");
15
}
16
- const [lang, page] = pagePath.split("/") as [LangId, PageSlug];
17
- pagePath = { lang, page };
+ const [lang, page] = pagePath.split("/");
+ pagePath = PagePathSchema.parse({ lang, page });
18
} else {
19
pagePath = PagePathSchema.parse(pagePath);
20
0 commit comments