This repository was archived by the owner on Mar 3, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
velog-frontend/src/containers/write Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments