Merge pull request 'refactor: Update ImportReviewCard to support AniList ID alongside MyAnimeList ID' (#28) from refactor into main
Reviewed-on: #28
This commit is contained in:
commit
122b0b5956
@ -200,9 +200,9 @@ export interface PageMangaImportJobDTO {
|
||||
|
||||
export interface PageableObject {
|
||||
offset?: number;
|
||||
paged?: boolean;
|
||||
pageNumber?: number;
|
||||
pageSize?: number;
|
||||
paged?: boolean;
|
||||
unpaged?: boolean;
|
||||
sort?: SortObject;
|
||||
}
|
||||
@ -353,7 +353,8 @@ export const DownloadContentArchiveContentArchiveFileType = {
|
||||
|
||||
export type ResolveMangaIngestReviewParams = {
|
||||
id: number;
|
||||
malId: string;
|
||||
malId?: number;
|
||||
aniListId?: number;
|
||||
};
|
||||
|
||||
export type GetContentProvidersParams = {
|
||||
|
||||
@ -23,6 +23,7 @@ export function ImportReviewCard({
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const [malId, setMalId] = useState("");
|
||||
const [aniListId, setAniListId] = useState("");
|
||||
|
||||
const { mutate: mutateDeleteImportReview } = useDeleteMangaIngestReview({
|
||||
mutation: {
|
||||
@ -47,13 +48,13 @@ export function ImportReviewCard({
|
||||
});
|
||||
|
||||
const handleResolve = () => {
|
||||
if (!malId.trim()) {
|
||||
alert("Please enter a MyAnimeList ID");
|
||||
if (!malId.trim() && !aniListId.trim()) {
|
||||
alert("Please enter an AniListID and/or a MyAnimeList ID");
|
||||
return;
|
||||
}
|
||||
|
||||
mutateResolveImportReview({
|
||||
params: { id: importReview.id, malId },
|
||||
params: { id: importReview.id, malId: Number(malId), aniListId: Number(aniListId) },
|
||||
});
|
||||
};
|
||||
|
||||
@ -96,15 +97,26 @@ export function ImportReviewCard({
|
||||
</div>
|
||||
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<label className="text-sm font-medium">MyAnimeList Manga ID</label>
|
||||
<div className="flex flex-row gap-4 w-full">
|
||||
<div className="w-full">
|
||||
<label className="text-sm font-medium">AniList Manga ID</label>
|
||||
<Input
|
||||
placeholder="Enter MAL ID to match manually"
|
||||
value={malId}
|
||||
onChange={(e) => setMalId(e.target.value)}
|
||||
placeholder="Enter AniList ID to match manually"
|
||||
value={aniListId}
|
||||
onChange={(e) => setAniListId(e.target.value)}
|
||||
className="mt-2"
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
<label className="text-sm font-medium">MyAnimeList Manga ID</label>
|
||||
<Input
|
||||
placeholder="Enter MAL ID to match manually"
|
||||
value={malId}
|
||||
onChange={(e) => setMalId(e.target.value)}
|
||||
className="mt-2"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user