-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] 관리자가 아닐때 어드민 페이지 로그인 시도시 alert 창 띄우기
- 기존에 AxiosResponse로 감싸서 반환할시에, 받아온 data의 message를 읽어올 수 없었습니다. - 따라서 response.dto라는 반환용 dto를 만들어서, 받아온 data를 감싸 반환하도록 수정하였습니다.
- Loading branch information
Showing
3 changed files
with
33 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* 반환용 DTO | ||
*/ | ||
export class ResponseDto<T> { | ||
message?: string; | ||
success?: boolean; | ||
data?: T; | ||
|
||
constructor(data?: any) { | ||
if (data.data) this.data = data.data; | ||
if (data.message) this.message = data.message; | ||
if (data.success) this.success = data.success; | ||
} | ||
} |
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