connect some api
This commit is contained in:
@@ -5,7 +5,7 @@ export * from "../../features/favorites/hooks/useFavorites"
|
||||
export * from "../../features/orders/hooks/useOrders"
|
||||
export * from "../../features/search/hooks/useSearch"
|
||||
export * from "../../features/profile/hooks/useUserProfile"
|
||||
export * from "./useOpenStore"
|
||||
export * from "../../features/openStore/hooks/useOpenStore"
|
||||
|
||||
export * from "../../features/cart/hooks/useAddresses"
|
||||
export * from "../../features/cart/hooks/usePaymentTypes"
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
// "use client"
|
||||
|
||||
// import { useMutation } from "@tanstack/react-query"
|
||||
// import { apiClient } from "@/lib/api"
|
||||
// import { API_ENDPOINTS } from "@/lib/config/api-endpoints"
|
||||
|
||||
// interface OpenStoreData {
|
||||
// firstName: string
|
||||
// lastName: string
|
||||
// email: string
|
||||
// phone: string
|
||||
// patentFile: File
|
||||
// }
|
||||
|
||||
// interface OpenStoreResponse {
|
||||
// success: boolean
|
||||
// message: string
|
||||
// }
|
||||
|
||||
// export function useOpenStore() {
|
||||
// return useMutation({
|
||||
// mutationFn: async (data: OpenStoreData) => {
|
||||
// const formData = new FormData()
|
||||
// formData.append("first_name", data.firstName)
|
||||
// formData.append("last_name", data.lastName)
|
||||
// formData.append("email", data.email)
|
||||
// formData.append("phone", data.phone)
|
||||
// formData.append("patent_file", data.patentFile)
|
||||
|
||||
// const response = await apiClient.post<OpenStoreResponse>(API_ENDPOINTS.openStore, formData, {
|
||||
// headers: {
|
||||
// "Content-Type": "multipart/form-data",
|
||||
// },
|
||||
// })
|
||||
// return response.data
|
||||
// },
|
||||
// })
|
||||
// }
|
||||
@@ -471,4 +471,35 @@ export interface UserOrderData {
|
||||
customer_name: string;
|
||||
customer_phone: string;
|
||||
customer_address?: string;
|
||||
}
|
||||
|
||||
// lib/types/api.ts içine eklenecek tipler
|
||||
|
||||
export interface FilterBrand {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface FilterCategory {
|
||||
id: number;
|
||||
parent_id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface FiltersResponse {
|
||||
message: string;
|
||||
data: {
|
||||
categories: FilterCategory[];
|
||||
brands: FilterBrand[];
|
||||
};
|
||||
}
|
||||
|
||||
// Existing types'a ekleme
|
||||
export interface ProductFilters {
|
||||
brands?: number[];
|
||||
categories?: number[];
|
||||
min_price?: number;
|
||||
max_price?: number;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
}
|
||||
Reference in New Issue
Block a user