-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'devkor-project:main' into main
- Loading branch information
Showing
4 changed files
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import logger from '@/config/winston'; | ||
import User from '@/entities/User'; | ||
import ServiceResult from '@/interfaces/common'; | ||
import { EMAIL_NOT_EXISTS } from '@/interfaces/error'; | ||
import { EMAIL_NOT_EXISTS, NOT_KOREA } from '@/interfaces/error'; | ||
import { userInfoDto } from '@/interfaces/userDto'; | ||
|
||
export const getUserInfo = async (userId: number): | ||
|
@@ -34,6 +34,10 @@ export const modifyUserInfo = async (userId: number, modifiedInfo: userInfoDto): | |
if (!user) { | ||
throw EMAIL_NOT_EXISTS; | ||
} | ||
const regex = /[a-z0-9][email protected]/; | ||
if (!regex.test(email)) { | ||
throw NOT_KOREA; | ||
} | ||
user.email = email; | ||
user.receiveEmail = receiveEmail; | ||
user.studentID = studentID; | ||
|