Skip to content

Commit

Permalink
fix: allow dashes in url key (#786)
Browse files Browse the repository at this point in the history
Co-authored-by: orig <[email protected]>
  • Loading branch information
origranot and orig committed May 20, 2024
1 parent d3840ef commit 197dc37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ export const CountriesChart = component$((props: CountriesChartProps) => {
const countryCode = getCountryCode(item);
const country = countryLookup.byIso(countryCode);
const displayName = selectedCategory.value === 'cities' ? item.field : country?.country;

if (!displayName) {
return null;
}

return (
<div key={item.field} class="group flex items-center justify-between hover:bg-gray-50 dark:hover:bg-gray-500/10">
<div class="relative z-10 flex h-8 w-full max-w-[calc(100%-2rem)] items-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ const CreateLinkInputSchema = z
.string()
.min(4, { message: 'The short link must be at least 4 characters long.' })
.max(20, { message: 'The short link cannot exceed 20 characters.' })
.regex(/^[a-zA-Z0-9]+$/, { message: 'The short link can only include letters and numbers.' }),
.regex(/^[a-zA-Z0-9-]*$/, {
message: 'The short link can only contain letters, numbers, and dashes.',
}),
expirationTime: z.string().optional(),
expirationTimeToggle: z.string().optional(),
passwordProtection: z
Expand Down

0 comments on commit 197dc37

Please sign in to comment.