Skip to content

Commit

Permalink
remove trailing slash validation from source
Browse files Browse the repository at this point in the history
  • Loading branch information
milewskibogumil committed Dec 12, 2024
1 parent abc0b3c commit 52e8d78
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions apps/sanity/schema/singleTypes/redirects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type RedirectTypes = {
const SlugValidation = (Rule: SlugRule) => Rule.custom((value) => {
if (!value || !value.current) return "The value can't be blank";
if (!value.current.startsWith("/")) return "The path must be a relative path (starts with /)";
if (value.current !== '/' && value.current.endsWith('/')) return 'Source paths must not end with a trailing slash (/)';
return true;
});

Expand Down Expand Up @@ -221,8 +220,6 @@ export default defineType({
return 'Each redirect must have a "source" property with a string value';
if (!redirect.source.startsWith('/'))
return 'Source paths must start with a forward slash (/)';
if (redirect.source !== '/' && redirect.source.endsWith('/'))
return 'Source paths must not end with a trailing slash (/)';
if (!redirect.destination || typeof redirect.destination !== 'string')
return 'Each redirect must have a "destination" property with a string value';
if (!redirect.destination.startsWith('/'))
Expand Down

0 comments on commit 52e8d78

Please sign in to comment.