Skip to content

Commit

Permalink
Merge pull request #38 from knovator/development
Browse files Browse the repository at this point in the history
Development_v1.3.4
  • Loading branch information
chavda-bhavik authored Oct 10, 2022
2 parents 5c2cc49 + ebf92bc commit e535cf0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@knovator/masters-admin",
"version": "1.3.3",
"version": "1.3.4",
"description": "Package for integrating Masters, Submasters functionality in React projects",
"main": "dist/index.js",
"module": "dist/masters-admin.esm.js",
Expand Down
4 changes: 4 additions & 0 deletions src/hook/useMaster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ const useMaster = ({ defaultLimit, routes, defaultSort = ["createdAt", 1], preCo
if (response?.code === "SUCCESS") {
setLoading(false)
onSuccess(CALLBACK_CODES.DELETE, response?.code, response?.message)
if (Array.isArray(list) && list.length === 1 && currentPageRef.current > 1) {
currentPageRef.current = currentPageRef.current - 1
}
getMastersList()
onCloseForm()
return
Expand All @@ -196,6 +199,7 @@ const useMaster = ({ defaultLimit, routes, defaultSort = ["createdAt", 1], preCo
}
const onChangePageSize = (size: number): void => {
limitRef.current = size
currentPageRef.current = 1
getMastersList()
}
const onChangeCurrentPage = (page: number): void => {
Expand Down
4 changes: 4 additions & 0 deletions src/hook/useSubMaster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ const useSubMaster = ({ defaultLimit, routes, defaultSort = ["seq", 1], preConfi
if (response?.code === "SUCCESS") {
setLoading(false)
onSuccess(CALLBACK_CODES.DELETE, response?.code, response?.message)
if (Array.isArray(list) && list.length === 1 && currentPageRef.current > 1) {
currentPageRef.current = currentPageRef.current - 1
}
getSubMastersList()
onCloseForm()
return
Expand Down Expand Up @@ -315,6 +318,7 @@ const useSubMaster = ({ defaultLimit, routes, defaultSort = ["seq", 1], preConfi
}
const onChangePageSize = (size: number): void => {
limitRef.current = size
currentPageRef.current = 1
setSequencing(false)
getSubMastersList()
}
Expand Down

0 comments on commit e535cf0

Please sign in to comment.