Skip to content

Commit f4fc71f

Browse files
committed
fix: removed user me endpoint
1 parent b2700a4 commit f4fc71f

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

app/controllers/user.controller.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { TypedRequestBody } from '@/types/typed-request'
2-
import type { NextFunction, Request, Response } from 'express'
2+
import type { NextFunction, Response } from 'express'
33
import type { Options } from 'nodemailer/lib/mailer'
44

55
import { prisma } from '@prisma'
@@ -13,15 +13,6 @@ import defaultAvatars from '@/data/default-avatars.json'
1313
import { EditUserSchema, NeedHelpSchema, ThemeSchema } from '@/utils/schemas'
1414

1515
class UserController {
16-
me = async (req: Request, res: Response) => {
17-
const user = await prisma.user.findFirst({
18-
where: { id: req.user.id },
19-
omit: { password: true }
20-
})
21-
22-
res.json(user)
23-
}
24-
2516
update = async (
2617
{ user, body, file }: TypedRequestBody<typeof EditUserSchema>,
2718
res: Response,

app/routes/api/user.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ export const userRouter = Router()
1010

1111
userRouter.use(authenticate)
1212

13-
userRouter.get('/me', userController.me)
14-
1513
userRouter.put(
1614
'/',
1715
upload.single('avatar'),

swagger.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,6 @@
178178
}
179179
}
180180
},
181-
"/user/me": {
182-
"get": {
183-
"tags": ["User"],
184-
"summary": "Get current user",
185-
"security": [{ "Bearer": [] }],
186-
"responses": {
187-
"200": { "$ref": "#/components/responses/UserResponse" },
188-
"401": { "$ref": "#/components/responses/Unauthorized" }
189-
}
190-
}
191-
},
192181
"/user/help": {
193182
"post": {
194183
"tags": ["User"],

0 commit comments

Comments
 (0)