fix(medusa): List Users return type (#6204)
This commit is contained in:
1 parent
489b7effb0
commit
6404b9abd1
3 files changed
+31
-1
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/medusa": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(medusa): Update list return type of `GET /admin/users`.
|
||||||
@@ -13,4 +13,16 @@ export interface AdminUsersListRes {
|
|||||||
* An array of users details.
|
* An array of users details.
|
||||||
*/
|
*/
|
||||||
users: Array<User>
|
users: Array<User>
|
||||||
|
/**
|
||||||
|
* The total number of items available
|
||||||
|
*/
|
||||||
|
count: number
|
||||||
|
/**
|
||||||
|
* The number of users skipped when retrieving the users.
|
||||||
|
*/
|
||||||
|
offset: number
|
||||||
|
/**
|
||||||
|
* The number of items per page
|
||||||
|
*/
|
||||||
|
limit: number
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { PaginatedResponse } from "@medusajs/types"
|
||||||
import { Router } from "express"
|
import { Router } from "express"
|
||||||
import { User } from "../../../../models/user"
|
import { User } from "../../../../models/user"
|
||||||
import { DeleteResponse } from "../../../../types/common"
|
import { DeleteResponse } from "../../../../types/common"
|
||||||
@@ -77,14 +78,26 @@ export type AdminUserRes = {
|
|||||||
* description: "The list of users."
|
* description: "The list of users."
|
||||||
* required:
|
* required:
|
||||||
* - users
|
* - users
|
||||||
|
* - count
|
||||||
|
* - offset
|
||||||
|
* - limit
|
||||||
* properties:
|
* properties:
|
||||||
* users:
|
* users:
|
||||||
* type: array
|
* type: array
|
||||||
* description: "An array of users details."
|
* description: "An array of users details."
|
||||||
* items:
|
* items:
|
||||||
* $ref: "#/components/schemas/User"
|
* $ref: "#/components/schemas/User"
|
||||||
|
* count:
|
||||||
|
* type: integer
|
||||||
|
* description: The total number of items available
|
||||||
|
* offset:
|
||||||
|
* type: integer
|
||||||
|
* description: The number of users skipped when retrieving the users.
|
||||||
|
* limit:
|
||||||
|
* type: integer
|
||||||
|
* description: The number of items per page
|
||||||
*/
|
*/
|
||||||
export type AdminUsersListRes = {
|
export type AdminUsersListRes = PaginatedResponse & {
|
||||||
users: Omit<User, "password_hash">[]
|
users: Omit<User, "password_hash">[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user