Skip to content

Commit 09a1ecd

Browse files
authored
fix: Improve redirect error message (#4831)
## Description [Discussion](https://discord.com/channels/955905230107738152/1334938982882082847) <img width="426" alt="image" src="https://github.com/user-attachments/assets/0816820d-c2be-4666-80f9-74eb7af2b169" /> ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
1 parent 5ad5a71 commit 09a1ecd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/sdk/src/schema/pages.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ export const PagePath = z
9292
.string()
9393
.refine((path) => path !== "", "Can't be empty")
9494
.refine((path) => path !== "/", "Can't be just a /")
95-
.refine((path) => path === "" || path.startsWith("/"), "Must start with a /")
95+
.refine(
96+
(path) => path === "" || path.startsWith("/"),
97+
"Must start with a / or a full URL e.g. https://website.org"
98+
)
9699
.refine((path) => path.endsWith("/") === false, "Can't end with a /")
97100
.refine((path) => path.includes("//") === false, "Can't contain repeating /")
98101
.refine(

0 commit comments

Comments
 (0)