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