fix(import): refine MangaDex ID validation logic in import dialog
All checks were successful
ci/woodpecker/push/pipeline Pipeline was successful
ci/woodpecker/pr/pipeline Pipeline was successful

This commit is contained in:
Rodrigo Verdiani 2025-11-02 15:09:13 -03:00
parent c48b88ff61
commit 2d39ba25e9

View File

@ -35,18 +35,7 @@ export const MangaDexImportDialog = ({
const formSchema = z
.object({
value: z.string().min(1, "Please enter a MangaDex ID or URL."),
})
.refine(
(data: { value: string }) =>
data.value.length > 36 &&
!data.value.match(/title\/([0-9a-fA-F-]{36})/) &&
data.value.length !== 36,
{
message: "Invalid MangaDex ID or URL",
path: ["value"],
abort: true,
},
);
});
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),