refactor: convert more files to typescript

This commit is contained in:
Prayag Prajapati committed 2024-11-25 17:33:30 +05:30
1 parent 81695a583d
commit a7eab72639
19 files changed
+93 -451

No files matched your search

+8 -5
View File
@@ -16,11 +16,11 @@ export default function LikeButton({
userId,
itemName,
}: {
itemId: string;
isFavorite: boolean;
queryKey: string[];
userId: string;
itemName: string;
itemId: string | undefined;
isFavorite: boolean | undefined;
queryKey: string[] | undefined;
userId: string | undefined;
itemName: string | undefined;
}) {
const api = useApiInContext((s) => s.api);
const queryClient = useQueryClient();
@@ -29,6 +29,9 @@ export default function LikeButton({
const handleLiking = async () => {
let result: UserItemDataDto = null!;
if (!api) return;
if (!userId) return;
if (!itemId) return;
if (!itemName) return;
if (isFavorite) {
result = (
await getUserLibraryApi(api).unmarkFavoriteItem({