fix(medusa): List Users return type (#6204)

This commit is contained in:
Kasper Fabricius Kristensen
2024-01-24 13:57:05 +01:00
committed by GitHub
parent 489b7effb0
commit 6404b9abd1
3 changed files with 31 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---
fix(medusa): Update list return type of `GET /admin/users`.

View File

@@ -13,4 +13,16 @@ export interface AdminUsersListRes {
* An array of users details.
*/
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
}

View File

@@ -1,3 +1,4 @@
import { PaginatedResponse } from "@medusajs/types"
import { Router } from "express"
import { User } from "../../../../models/user"
import { DeleteResponse } from "../../../../types/common"
@@ -77,14 +78,26 @@ export type AdminUserRes = {
* description: "The list of users."
* required:
* - users
* - count
* - offset
* - limit
* properties:
* users:
* type: array
* description: "An array of users details."
* items:
* $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">[]
}