File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -960,12 +960,17 @@ export type CreatePostInMultipleSourcesResponse = Array<{
960960export const createPostInMultipleSources = async (
961961 variables : CreatePostInMultipleSourcesArgs ,
962962) => {
963+ const { image, ...rest } = variables ;
964+ const sanitized = {
965+ ...rest ,
966+ ...( image instanceof File && image . size > 0 ? { image } : { } ) ,
967+ } ;
963968 const res = await gqlClient . request <
964969 {
965970 createPostInMultipleSources : CreatePostInMultipleSourcesResponse ;
966971 } ,
967972 CreatePostInMultipleSourcesArgs
968- > ( CREATE_POST_IN_MULTIPLE_SOURCES , variables ) ;
973+ > ( CREATE_POST_IN_MULTIPLE_SOURCES , sanitized ) ;
969974 return res . createPostInMultipleSources ;
970975} ;
971976
Original file line number Diff line number Diff line change @@ -182,10 +182,11 @@ function CreatePost(): ReactElement {
182182 return ;
183183 }
184184
185- const { options, ...args } = params ;
185+ const { options, image , ...args } = params ;
186186
187187 await onCreate ( {
188188 ...args ,
189+ ...( image instanceof File && image . size > 0 && { image } ) ,
189190 ...( options ?. length && {
190191 options : options . map ( ( text , order ) => ( {
191192 text,
You can’t perform that action at this time.
0 commit comments