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 14:55:35 -03:00
parent 850a9f95e9
commit 6ee1fbbd8c

View File

@ -38,19 +38,14 @@ export const MangaDexImportDialog = ({
})
.refine(
(data: { value: string }) =>
data.value.length > 36 &&
!data.value.match(/title\/([0-9a-fA-F-]{36})/),
(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,
},
)
.refine((data: { value: string }) => data.value.length !== 36, {
message: "Invalid MangaDex ID",
path: ["value"],
abort: true,
});
);
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),