TF-87 loan management refahi

This commit is contained in:
2023-08-29 14:26:35 +03:30
parent 2a4d63809d
commit e1f87576ce
8 changed files with 408 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
import {createContext, useEffect, useState} from "react";
import {GET_LOAN_STATE_REFAHI} from "@/core/data/apiRoutes";
import useRequest from "@/lib/app/hooks/useRequest";
export const LoanStateRefahiContext = createContext();
export const LoanStateRefahiProvider = ({children}) => {
const [detail, setDetail] = useState([])
const requestServer = useRequest({auth: true, notification: false})
useEffect(() => {
requestServer(GET_LOAN_STATE_REFAHI, "get").then((response) => {
setDetail(response.data.data)
}).catch(() => {
})
}, []);
console.log(detail)
return (
<LoanStateRefahiContext.Provider
value={detail}
>
{children}
</LoanStateRefahiContext.Provider>
);
}