Skip to content

Commit add9736

Browse files
committed
Fixes velopert#69
1 parent 8efe015 commit add9736

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

velog-frontend/src/containers/write/SubmitBoxContainer.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,20 @@ class SubmitBoxContainer extends Component<Props> {
240240
return categories.filter(c => c.active).map(c => c.id);
241241
})();
242242

243+
if (!title) {
244+
BaseActions.showToast({
245+
type: 'error',
246+
message: '제목을 입력해주세요',
247+
});
248+
return;
249+
}
250+
if (!body) {
251+
BaseActions.showToast({
252+
type: 'error',
253+
message: '내용을 입력해주세요',
254+
});
255+
return;
256+
}
243257
try {
244258
if (!postData) {
245259
await WriteActions.writePost({
@@ -277,7 +291,10 @@ class SubmitBoxContainer extends Component<Props> {
277291
message: '포스트가 임시저장 되었습니다',
278292
});
279293
} catch (e) {
280-
console.log(e);
294+
BaseActions.showToast({
295+
type: 'error',
296+
message: '임시저장 실패',
297+
});
281298
}
282299
};
283300

@@ -369,7 +386,7 @@ class SubmitBoxContainer extends Component<Props> {
369386
body={body}
370387
meta={meta}
371388
urlSlug={urlSlug}
372-
username={username}
389+
username={username || ''}
373390
realMeta={postData && postData.meta}
374391
onChangeCodeTheme={onChangeCodeTheme}
375392
onChangeShortDescription={onChangeShortDescription}

0 commit comments

Comments
 (0)