base logig pages cart shipping and payment

This commit is contained in:
hamid zarghami
2025-09-14 12:47:51 +03:30
parent 7b05f96576
commit 6d52d1e91a
13 changed files with 663 additions and 82 deletions
+12
View File
@@ -0,0 +1,12 @@
import { useQuery } from "@tanstack/react-query";
import * as api from "../service/Service";
import { useSharedStore } from "@/share/store/sharedStore";
export const useGetProfile = () => {
const { isLogin } = useSharedStore();
return useQuery({
queryKey: ["profile"],
queryFn: api.getProfile,
enabled: isLogin,
});
};
+7
View File
@@ -0,0 +1,7 @@
import axios from "@/config/axios";
import { UserMeResponseType } from "@/share/types/SharedTypes";
export const getProfile = async () => {
const { data } = await axios.get<UserMeResponseType>("/user/profile");
return data;
};