structure payment methods
This commit is contained in:
@@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user