Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
travel
Commits
90581820
Commit
90581820
authored
Jul 28, 2022
by
Yoon, Daeki
😅
Browse files
코드 정리
parent
02b43c26
Changes
1
Show whitespace changes
Inline
Side-by-side
src/controllers/user.controller.ts
View file @
90581820
...
...
@@ -48,36 +48,15 @@ export const updateProfile = asyncWrap(async (reqExp, res) => {
res
.
json
(
user
);
}
else
{
// 같은 사진이 DB안에 존재할 경우
await
fs
.
unlink
(
avatar
.
filepath
);
// await FileInfo.deleteOne({ _id: user?.avatar }); // 덮기 전의 FileInfo 삭제
// 덮기 전의 FileInfo 삭제
// await FileInfo.deleteOne({ _id: user?.avatar });
const
user
=
await
User
.
findById
(
userId
);
if
(
user
!==
null
)
{
user
.
avatar
=
duplicate
.
_id
;
await
user
.
save
();
}
}
// if (!Array.isArray(file.avatar)) {
// //파일 좁히기 중
// if (!Array.isArray(field.nickname)) {
// const nickname = field.nickname;
// if (!(file.avatar === undefined)) {
// const originalfilename = file.avatar.originalFilename;
// const newfilename = file.avatar.newFilename;
// const picturepath = file.avatar.filepath;
// userDb.updateProfile(
// userId,
// nickname,
// originalfilename,
// newfilename,
// picturepath
// );
// } else {
// userDb.updateProfile(userId, nickname);
// }
// }
// }
});
export
const
deleteUser
=
asyncWrap
(
async
(
reqExp
,
res
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment