-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**What** - refactor users domain to use `DataTable` - add search params to `User` module models
- Loading branch information
Showing
10 changed files
with
97 additions
and
88 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
packages/admin-next/dashboard/src/hooks/table/query/use-sales-channel-table-query.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/admin-next/dashboard/src/hooks/table/query/use-user-invite-table-query.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { useQueryParams } from "../../use-query-params" | ||
|
||
type UseUserInviteTableQueryProps = { | ||
prefix?: string | ||
pageSize?: number | ||
} | ||
|
||
export const useUserInviteTableQuery = ({ | ||
prefix, | ||
pageSize = 20, | ||
}: UseUserInviteTableQueryProps) => { | ||
const queryObject = useQueryParams( | ||
["offset", "q", "order", "created_at", "updated_at"], | ||
prefix | ||
) | ||
|
||
const { offset, created_at, updated_at, q, order } = queryObject | ||
|
||
const searchParams = { | ||
limit: pageSize, | ||
offset: offset ? Number(offset) : 0, | ||
order, | ||
created_at: created_at ? JSON.parse(created_at) : undefined, | ||
updated_at: updated_at ? JSON.parse(updated_at) : undefined, | ||
q, | ||
} | ||
|
||
return { | ||
searchParams, | ||
raw: queryObject, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters