Skip to content

Commit

Permalink
Fix: docs and validator for withdraw endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kmc7468 committed Jan 22, 2025
1 parent 4d63ff8 commit 7665b97
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
22 changes: 20 additions & 2 deletions src/routes/docs/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,29 @@ usersDocs[`${apiPrefix}/withdraw`] = {
tags: [tag],
summary: "회원 탈퇴",
description: "회원 탈퇴를 요청합니다.",
parameters: [
{
in: "query",
name: "redirect",
schema: {
type: "string",
},
description: "로그아웃 후 리다이렉트 URI",
},
],
responses: {
200: {
content: {
"text/html": {
example: "Users/withdraw : withdraw successful",
"application/json": {
schema: {
type: "object",
properties: {
ssoLogoutUrl: {
type: "string",
description: "SSO 로그아웃 URL",
},
},
},
},
},
},
Expand Down
9 changes: 7 additions & 2 deletions src/routes/users.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import express from "express";
import { body } from "express-validator";
import { body, query } from "express-validator";
import { authMiddleware, validatorMiddleware } from "@/middlewares";
import patterns from "@/modules/patterns";

Expand Down Expand Up @@ -60,6 +60,11 @@ router.get("/resetProfileImg", userHandlers.resetProfileImgHandler);
router.get("/getBanRecord", userHandlers.getBanRecordHandler);

// 회원 탈퇴를 요청합니다.
router.post("/withdraw", userHandlers.withdrawHandler);
router.post(
"/withdraw",
query("redirect").optional().isString(),
validatorMiddleware,
userHandlers.withdrawHandler
);

export default router;

0 comments on commit 7665b97

Please sign in to comment.