|
|
@@ -5,7 +5,8 @@ import { authMiddleware } from '../../middleware/auth.middleware';
|
|
|
import { ErrorSchema } from '../../utils/errorHandler';
|
|
|
import { AppDataSource } from '../../data-source';
|
|
|
import { AuthContext } from '../../types/context';
|
|
|
-import { UserListResponse } from '../../modules/users/user.schema';
|
|
|
+import { UserListResponse, UserSchema } from '../../modules/users/user.schema';
|
|
|
+import { parseWithAwait } from '@/server/utils/parseWithAwait';
|
|
|
|
|
|
const userService = new UserService(AppDataSource);
|
|
|
|
|
|
@@ -69,7 +70,7 @@ const app = new OpenAPIHono<AuthContext>().openapi(listUsersRoute, async (c) =>
|
|
|
});
|
|
|
|
|
|
return c.json({
|
|
|
- data: users,
|
|
|
+ data: await parseWithAwait(z.array(UserSchema), users),
|
|
|
pagination: {
|
|
|
total,
|
|
|
current: page,
|