add API routes
This commit is contained in:
@@ -3,7 +3,7 @@ import {useTranslations} from "next-intl";
|
||||
import useRequest from "@/lib/app/hooks/useRequest";
|
||||
import * as Yup from "yup";
|
||||
import {useFormik} from "formik";
|
||||
import {ADD_USER_MANAGEMENT} from "@/core/data/apiRoutes";
|
||||
import {ADD_ADMIN_SETTING} from "@/core/data/apiRoutes";
|
||||
|
||||
const CreateContent = ({mutate, setOpenConfirmDialog}) => {
|
||||
const t = useTranslations();
|
||||
@@ -24,7 +24,7 @@ const CreateContent = ({mutate, setOpenConfirmDialog}) => {
|
||||
formData.append("name", values.name);
|
||||
formData.append("value", values.value);
|
||||
|
||||
requestServer(ADD_USER_MANAGEMENT, 'post', {
|
||||
requestServer(ADD_ADMIN_SETTING, 'post', {
|
||||
data: formData,
|
||||
}).then((response) => {
|
||||
setOpenConfirmDialog(false)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {UPDATE_USER_MANAGEMENT} from "@/core/data/apiRoutes";
|
||||
import {UPDATE_ADMIN_SETTING} from "@/core/data/apiRoutes";
|
||||
import useNotification from "@/lib/app/hooks/useNotification";
|
||||
import useRequest from "@/lib/app/hooks/useRequest";
|
||||
import {Button, DialogActions, DialogContent, Stack, TextField} from "@mui/material"
|
||||
@@ -26,7 +26,7 @@ const UpdateContent = ({row, mutate, setOpenConfirmDialog}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("name", values.name);
|
||||
formData.append("value", values.value);
|
||||
requestServer(`${UPDATE_USER_MANAGEMENT}/${row.getValue("id")}`, 'post', {
|
||||
requestServer(`${UPDATE_ADMIN_SETTING}/${row.getValue("id")}`, 'post', {
|
||||
data: formData,
|
||||
}).then((response) => {
|
||||
setOpenConfirmDialog(false)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Box, Typography} from "@mui/material";
|
||||
import {useMemo} from "react";
|
||||
import {GET_MACHINARY_OFFICE} from "@/core/data/apiRoutes";
|
||||
import {GET_ADMIN_SETTING} from "@/core/data/apiRoutes";
|
||||
import {useTranslations} from "next-intl";
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import TableRowActions from "@/components/dashboard/admin-setting/TableRowActions";
|
||||
@@ -56,12 +56,16 @@ function DashboardAdminSettingComponent() {
|
||||
id: 1,
|
||||
name: "amin",
|
||||
value: "hi"
|
||||
}, {
|
||||
id: 1,
|
||||
name: "amin",
|
||||
value: "hi"
|
||||
}]
|
||||
return (
|
||||
<Box sx={{px: 3}}>
|
||||
<DataTable
|
||||
data={data}
|
||||
tableUrl={GET_MACHINARY_OFFICE}
|
||||
tableUrl={GET_ADMIN_SETTING}
|
||||
columns={columns}
|
||||
selectableRow={false}
|
||||
enableCustomToolbar={true}
|
||||
|
||||
@@ -234,6 +234,11 @@ export const GET_LOAN_HISTORY = BASE_URL + "/dashboard/navgan_loans"
|
||||
export const GET_HISTORY_DETAIL = BASE_URL + "/dashboard/navgan_loans"
|
||||
export const EXPORT_LOAN_HISTORY = BASE_URL + "/dashboard/navgan_loans/export"
|
||||
|
||||
//admin setting
|
||||
export const GET_ADMIN_SETTING = BASE_URL + ""
|
||||
export const ADD_ADMIN_SETTING = BASE_URL + ""
|
||||
export const UPDATE_ADMIN_SETTING = BASE_URL + ""
|
||||
|
||||
// loan statistics
|
||||
export const GET_LOAN_STATISTICS = BASE_URL + "/dashboard/reports/navgan/statistics"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user