fix(admin): fix admin promotion list sort (#13872)
* 🐛 Fix admin promotion list sort * Create six-squids-vanish.md --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
1 parent
fa93f18f7d
commit
47b2f7f888
2 files changed
+8
-2
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/dashboard": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
🐛 Fix admin promotion list sort
|
||||||
@@ -11,17 +11,18 @@ export const usePromotionTableQuery = ({
|
|||||||
pageSize = 20,
|
pageSize = 20,
|
||||||
}: UsePromotionTableQueryProps) => {
|
}: UsePromotionTableQueryProps) => {
|
||||||
const queryObject = useQueryParams(
|
const queryObject = useQueryParams(
|
||||||
["offset", "q", "created_at", "updated_at"],
|
["offset", "q", "order", "created_at", "updated_at"],
|
||||||
prefix
|
prefix
|
||||||
)
|
)
|
||||||
|
|
||||||
const { offset, q, created_at, updated_at } = queryObject
|
const { offset, q, order, created_at, updated_at } = queryObject
|
||||||
|
|
||||||
const searchParams: HttpTypes.AdminGetPromotionsParams = {
|
const searchParams: HttpTypes.AdminGetPromotionsParams = {
|
||||||
limit: pageSize,
|
limit: pageSize,
|
||||||
created_at: created_at ? JSON.parse(created_at) : undefined,
|
created_at: created_at ? JSON.parse(created_at) : undefined,
|
||||||
updated_at: updated_at ? JSON.parse(updated_at) : undefined,
|
updated_at: updated_at ? JSON.parse(updated_at) : undefined,
|
||||||
offset: offset ? Number(offset) : 0,
|
offset: offset ? Number(offset) : 0,
|
||||||
|
order,
|
||||||
q,
|
q,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user