File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -145,14 +145,16 @@ const useHintUpload = () => {
145145 answerFiles : File [ ]
146146 ) => {
147147 try {
148- const presignedResponse = await presignedMutation . mutateAsync ( {
149- themeId : formData . themeId ,
150- hintImageCount : hintFiles . length ,
151- answerImageCount : answerFiles . length ,
152- } ) ;
148+ const presignedResponse =
149+ hintFiles . length > 0 || answerFiles . length > 0
150+ ? await presignedMutation . mutateAsync ( {
151+ themeId : formData . themeId ,
152+ hintImageCount : hintFiles . length ,
153+ answerImageCount : answerFiles . length ,
154+ } )
155+ : { data : { hintImageUrlList : [ ] , answerImageUrlList : [ ] } } ;
153156
154- const { hintImageUrlList = [ ] , answerImageUrlList = [ ] } =
155- presignedResponse . data ;
157+ const { hintImageUrlList, answerImageUrlList } = presignedResponse . data ;
156158
157159 if ( hintFiles . length > 0 ) {
158160 await Promise . all (
You can’t perform that action at this time.
0 commit comments