Merge pull request 'fix(import): refine MangaDex ID validation logic in import dialog' (#7) from fix/manga-dex into main
Some checks are pending
ci/woodpecker/push/pipeline Pipeline is running
Some checks are pending
ci/woodpecker/push/pipeline Pipeline is running
Reviewed-on: #7
This commit is contained in:
commit
313f3cdfcf
@ -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),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user