Skip to content

Commit

Permalink
feat(notice-detail): link delete & send-email api in notice-detail-pa…
Browse files Browse the repository at this point in the history
…ge (cloudforet-io#3241)

* feat(notice-detail): link delete & send email api in notice-detail-page

* fix(notice-detail): add annotation for postponing send email api

* fix(notice-detail): add song-lang annotation & rollback send-email api

* fix(notice-detail): add annotation for send-email api
  • Loading branch information
piggggggggy authored Aug 11, 2022
1 parent bff6d94 commit 5b93309
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions src/services/info/notice/notice-detail/NoticeDetailPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ import type { TranslateResult } from 'vue-i18n';
import { SpaceRouter } from '@/router';
import { store } from '@/store';
import { i18n } from '@/translations';
import { showSuccessMessage } from '@/lib/helper/notice-alert-helper';
import TextEditorViewer from '@/common/components/editor/TextEditorViewer.vue';
import DeleteModal from '@/common/components/modals/DeleteModal.vue';
Expand All @@ -112,7 +115,6 @@ import ListItem from '@/services/info/notice/modules/list-item/ListItem.vue';
import type { NoticePostModel } from '@/services/info/notice/type';
import { INFO_ROUTE } from '@/services/info/route-config';
export default {
name: 'NoticeDetailPage',
components: {
Expand Down Expand Up @@ -196,20 +198,34 @@ export default {
const handleBackToListButtonClick = () => {
SpaceRouter.router.push({ name: INFO_ROUTE.NOTICE._NAME });
};
const handleSendEmailConfirm = () => {
const handleSendEmailConfirm = async () => {
try {
// TODD:: Notice send email API
// TODO:추후 확인 필요
await SpaceConnector.client.board.post.sendNotification({
post_id: props.postId,
board_id: props.boardId,
});
// song-lang
showSuccessMessage(i18n.t('Successfully Sent Email'), '');
} catch (e) {
// TODD:: Error Handling
// song-lang
ErrorHandler.handleRequestError(e, i18n.t('에러 메시지!'));
} finally {
modalState.sendEmailModalVisible = false;
}
};
const handleDeleteNoticeConfirm = () => {
const handleDeleteNoticeConfirm = async () => {
try {
// TODD:: Notice delete API
await SpaceConnector.client.board.post.delete({
post_id: props.postId,
board_id: props.boardId,
});
// song-lang
showSuccessMessage(i18n.t('Successfully Deleted Notice'), '');
SpaceRouter.router.go(-1);
} catch (e) {
// TODD:: Error Handling
// song-lang
ErrorHandler.handleRequestError(e, i18n.t('에러 메시지!'));
} finally {
modalState.deleteModalVisible = false;
}
Expand Down

0 comments on commit 5b93309

Please sign in to comment.