TF-87 loan management refahi
This commit is contained in:
25
src/lib/prefetchDataTable/hooks/LoanStateRefahi.jsx
Normal file
25
src/lib/prefetchDataTable/hooks/LoanStateRefahi.jsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user