From 6f7112290000281f383ef8392a3added9cddfcce Mon Sep 17 00:00:00 2001 From: Jung SongYi Date: Fri, 4 Jun 2021 18:03:33 +0900 Subject: [PATCH] Add #220 deleting profile image action in postProfile --- controllers/profile/postProfile.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controllers/profile/postProfile.ts b/controllers/profile/postProfile.ts index 6e184cf..afd7dba 100644 --- a/controllers/profile/postProfile.ts +++ b/controllers/profile/postProfile.ts @@ -46,7 +46,11 @@ const postProfile = async (req: Request, res: Response) => { : console.log(`🧡postProfile-${__dirname}/../../uploads/${imageRoute}를 정상적으로 삭제했습니다`), ); }); - foundUser.uploadImage = uploadImage; + if (uploadImage === 'deleteImage') { + foundUser.uploadImage = ''; + } else { + foundUser.uploadImage = uploadImage; + } } foundUser.profileColor = randomColorGenerator(); const stackArray = [];