Commit 668f560c by Giang Tran

update code

parent 0966bc70
/* eslint-disable handle-callback-err */
import { PostData, GetURL } from '../../helpers'
import url from '../../url'
export const getListCategorys = async (body) =>
PostData(url.urlGetCategory, body)
.then((res) => res)
.catch((err) => null)
export const createCategory = async (body) =>
PostData(url.urlCreateCategory, body)
.then((res) => res)
.catch((err) => null)
export const updateCategory = async (body) =>
PostData(url.urlUpdateCategory, body)
.then((res) => res)
.catch((err) => null)
export const detailCategory = async (id, body) =>
GetURL(`${url.urlDetailCategory}/${id}`, body)
.then((res) => res)
.catch((err) => null)
export const deleteCategory = async (body) =>
PostData(url.urlDeleteCategory, body)
.then((res) => res)
.catch((err) => null)
/* eslint-disable handle-callback-err */
import { PostData, GetURL } from '../../helpers'
import url from '../../url'
export const getListCategoryTypes = async (body) =>
PostData(url.urlGetCategoryType, body)
.then((res) => res)
.catch((err) => null)
export const createCategoryType = async (body) =>
PostData(url.urlCreateCategoryType, body)
.then((res) => res)
.catch((err) => null)
export const updateCategoryType = async (body) =>
PostData(url.urlUpdateCategoryType, body)
.then((res) => res)
.catch((err) => null)
export const detailCategoryType = async (id, body) =>
GetURL(`${url.urlDetailCategoryType}/${id}`, body)
.then((res) => res)
.catch((err) => null)
export const deleteCategoryType = async (body) =>
PostData(url.urlDeleteCategoryType, body)
.then((res) => res)
.catch((err) => null)
/* eslint-disable handle-callback-err */
import { PostData, GetURL, GetData } from '../../helpers'
import url from '../../url'
export const getLogAuth = async (body) =>
PostData(url.logAuth, body)
.then((res) => res)
.catch((err) => null)
export const getLogAction = async (body) =>
PostData(url.logAction, body)
.then((res) => res)
.catch((err) => null)
export const getLogApi = async (body) =>
PostData(url.logApi, body)
.then((res) => res)
.catch((err) => null)
...@@ -37,6 +37,15 @@ export default { ...@@ -37,6 +37,15 @@ export default {
urlListActionByGroup: `${root}/usergroup/permission`, urlListActionByGroup: `${root}/usergroup/permission`,
changeStatusGroup: `${root}/usergroup/changeStatus`, changeStatusGroup: `${root}/usergroup/changeStatus`,
// Tài khoản
urlGetEmployee: `${root}/user/list`,
urlCreateEmployee: `${root}/user/create`,
urlUpdateEmployee: `${root}/user/update`,
urlDeleteEmployee: `${root}/user/delete`,
urlDetailEmployee: `${root}/user`,
changeStatusEmployee: `${root}/user/changeStatus`,
actionByGroup: `${root}/usergroup/permission`,
//product-type //product-type
urlGetListProductType: `${root}/poducttype/list`, urlGetListProductType: `${root}/poducttype/list`,
urlCreateProductType: `${root}/poducttype/create`, urlCreateProductType: `${root}/poducttype/create`,
...@@ -53,6 +62,11 @@ export default { ...@@ -53,6 +62,11 @@ export default {
urlDetailProduct: `${root}/product`, urlDetailProduct: `${root}/product`,
changeStatusProduct: `${root}/product/changeStatus`, changeStatusProduct: `${root}/product/changeStatus`,
//Log
logAuth: `${root}/logging/listLogin`,
logApi: `${root}/logging/listCallApi`,
logAction: `${root}/logging/listAction`,
//dropdown //dropdown
dropdownFuntions: `${root}/dropdown/function`, dropdownFuntions: `${root}/dropdown/function`,
dropdownPermission: `${root}/function/getFunctionTree`, dropdownPermission: `${root}/function/getFunctionTree`,
......
...@@ -187,7 +187,7 @@ function TableList(props) { ...@@ -187,7 +187,7 @@ function TableList(props) {
className={classes.formControl} className={classes.formControl}
> >
<MenuItem value={1}> <MenuItem value={1}>
Hin th Hot động
</MenuItem> </MenuItem>
<MenuItem value={2}>Khóa</MenuItem> <MenuItem value={2}>Khóa</MenuItem>
</Select> </Select>
......
...@@ -56,6 +56,7 @@ const ToolNotificate = (props) => { ...@@ -56,6 +56,7 @@ const ToolNotificate = (props) => {
} }
const getData = async () => { const getData = async () => {
try {
props.showLoading() props.showLoading()
const res = await getListEmployees({ const res = await getListEmployees({
full_name: searchDebount, full_name: searchDebount,
...@@ -77,6 +78,7 @@ const ToolNotificate = (props) => { ...@@ -77,6 +78,7 @@ const ToolNotificate = (props) => {
} else { } else {
// enqueueSnackbar('Error!', { variant: 'error' }) // enqueueSnackbar('Error!', { variant: 'error' })
} }
} catch (error) {}
} }
useEffect(() => { useEffect(() => {
......
...@@ -185,7 +185,7 @@ function TableList(props) { ...@@ -185,7 +185,7 @@ function TableList(props) {
className={classes.formControl} className={classes.formControl}
> >
<MenuItem value={1}> <MenuItem value={1}>
Hin th Hot động
</MenuItem> </MenuItem>
<MenuItem value={2}>Khóa</MenuItem> <MenuItem value={2}>Khóa</MenuItem>
</Select> </Select>
......
...@@ -192,7 +192,7 @@ function TableList(props) { ...@@ -192,7 +192,7 @@ function TableList(props) {
className={classes.formControl} className={classes.formControl}
> >
<MenuItem value={1}> <MenuItem value={1}>
Hin th Hot động
</MenuItem> </MenuItem>
<MenuItem value={2}>Khóa</MenuItem> <MenuItem value={2}>Khóa</MenuItem>
</Select> </Select>
......
...@@ -184,7 +184,7 @@ function TableList(props) { ...@@ -184,7 +184,7 @@ function TableList(props) {
className={classes.formControl} className={classes.formControl}
> >
<MenuItem value={1}> <MenuItem value={1}>
Hin th Hot động
</MenuItem> </MenuItem>
<MenuItem value={2}>Khóa</MenuItem> <MenuItem value={2}>Khóa</MenuItem>
</Select> </Select>
......
...@@ -192,7 +192,7 @@ function TableList(props) { ...@@ -192,7 +192,7 @@ function TableList(props) {
className={classes.formControl} className={classes.formControl}
> >
<MenuItem value={1}> <MenuItem value={1}>
Hin th Hot động
</MenuItem> </MenuItem>
<MenuItem value={2}>Khóa</MenuItem> <MenuItem value={2}>Khóa</MenuItem>
</Select> </Select>
......
...@@ -184,7 +184,7 @@ function TableList(props) { ...@@ -184,7 +184,7 @@ function TableList(props) {
className={classes.formControl} className={classes.formControl}
> >
<MenuItem value={1}> <MenuItem value={1}>
Hin th Hot động
</MenuItem> </MenuItem>
<MenuItem value={2}>Khóa</MenuItem> <MenuItem value={2}>Khóa</MenuItem>
</Select> </Select>
......
...@@ -179,7 +179,7 @@ function TableList(props) { ...@@ -179,7 +179,7 @@ function TableList(props) {
className={classes.formControl} className={classes.formControl}
> >
<MenuItem value={1}> <MenuItem value={1}>
Hin th Hot động
</MenuItem> </MenuItem>
<MenuItem value={2}>Khóa</MenuItem> <MenuItem value={2}>Khóa</MenuItem>
</Select> </Select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment