add next app

This commit is contained in:
2026-02-18 03:22:17 +03:00
parent d16b38e6e1
commit e62e7bf3a8
26 changed files with 4752 additions and 0 deletions

30
web/src/api/wishlists.ts Normal file
View File

@@ -0,0 +1,30 @@
import { $axios } from "@/lib/axios";
import { useQuery } from "@tanstack/react-query";
export type Wishlist = {
uuid: string;
name: string;
description: string;
createdAt: string;
updatedAt: string;
};
export const useUserWishlistsQuery = () => {
return useQuery({
queryKey: ["wishlists"],
queryFn: async () => {
const resp = await $axios.get<Wishlist[]>("/user/wishlists");
return resp.data;
},
});
};
export const useWishlistQuery = (uuid: string) => {
return useQuery({
queryKey: ["wishlists", uuid],
queryFn: async () => {
const resp = await $axios.get<Wishlist>(`/wishlists/${uuid}`);
return resp.data;
},
});
};