This repository was archived by the owner on Feb 3, 2025. It is now read-only.
File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ export function AddMangaForm({ onClose }: { onClose: () => void }) {
91
91
form . setFieldValue ( 'query' , '' ) ;
92
92
form . setFieldValue ( 'mangaOrder' , - 1 ) ;
93
93
form . setFieldValue ( 'mangaTitle' , '' ) ;
94
+ form . setFieldValue ( 'interval' , '' ) ;
94
95
}
95
96
if ( active === 3 ) {
96
97
form . setFieldValue ( 'interval' , '' ) ;
@@ -117,7 +118,7 @@ export function AddMangaForm({ onClose }: { onClose: () => void }) {
117
118
title : 'Manga' ,
118
119
message : (
119
120
< Text >
120
- Failed to create add manga. < Code color = "red" > { `${ err } ` } </ Code >
121
+ < Code color = "red" > { `${ err } ` } </ Code >
121
122
</ Text >
122
123
) ,
123
124
} ) ;
Original file line number Diff line number Diff line change
1
+ import { TRPCError } from '@trpc/server' ;
1
2
import { z } from 'zod' ;
2
3
import { getAvailableSources , getMangaDetail , search } from '../../../utils/mangal' ;
3
4
import { t } from '../trpc' ;
@@ -71,7 +72,10 @@ export const mangaRouter = t.router({
71
72
} ,
72
73
} ) ;
73
74
if ( result ) {
74
- return result ;
75
+ throw new TRPCError ( {
76
+ code : 'CONFLICT' ,
77
+ message : `${ title } already exists in the library.` ,
78
+ } ) ;
75
79
}
76
80
77
81
return ctx . prisma . manga . create ( {
You can’t perform that action at this time.
0 commit comments