structure payment methods

This commit is contained in:
hamid zarghami
2025-11-23 09:59:37 +03:30
parent c984e719d7
commit 342acaac96
7 changed files with 64 additions and 2 deletions
+11
View File
@@ -0,0 +1,11 @@
import { type FC } from 'react'
const PaymentMethodsList: FC = () => {
return (
<div className='mt-5'>
<h1 className='text-lg font-light'>لیست روش های پرداخت</h1>
</div>
)
}
export default PaymentMethodsList
@@ -0,0 +1,16 @@
import * as api from "../service/PaymentMethodService";
import { useQuery } from "@tanstack/react-query";
export const useGetPaymentMethods = () => {
return useQuery({
queryKey: ["payment-methods"],
queryFn: api.getPaymentMethods,
});
};
export const useGetRestaurantPaymentMethods = () => {
return useQuery({
queryKey: ["restaurant-payment-methods"],
queryFn: api.getRestaurantPaymentMethods,
});
};
@@ -0,0 +1,11 @@
import axios from "@/config/axios";
export const getPaymentMethods = async () => {
const { data } = await axios.get("/admin/payment-methods");
return data;
};
export const getRestaurantPaymentMethods = async () => {
const { data } = await axios.get("/admin/restaurant-payment-methods");
return data;
};