Skip to content

Commit

Permalink
Merge pull request #21 from TickLabVN/fix/change-result-of-get-user-b…
Browse files Browse the repository at this point in the history
…y-id

fix(user.handler.ts): change return of api/user to {id, email}
  • Loading branch information
quannhg authored Nov 15, 2023
2 parents 40f6f9d + b7fb5a3 commit de0f964
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dtos/out/user/user.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Static, Type } from '@sinclair/typebox';

export const UserDto = Type.Object({
id: ObjectId,
userName: Type.String({ format: 'userName' })
email: Type.String({ format: 'email' })
});

export type UserDto = Static<typeof UserDto>;
2 changes: 1 addition & 1 deletion src/handlers/user.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const getUserById: Handler<UserDto> = async (req, res) => {
const user = await prisma.user.findUnique({
select: {
id: true,
userName: true
email: true
},
where: { id: userId }
});
Expand Down

0 comments on commit de0f964

Please sign in to comment.