Skip to content
Discussion options

You must be logged in to vote

Old question but I want to share my way of solving the problem.

Because mutation function variables are agnostic enough (default type is any). I pass a callback function to track ProgressEvent in onUploadProgress

I do post to express with uses multer. This example can handle single file per request.

const post_path = '/api/upload';

export interface UseMutationUploadFileVariables {
    ParentLink_Category: string,
    ParentLink_RecID: string,
    RecId: string
    progressCallBack?: (progressEvent: ProgressEvent) => void
    file: File
}

const mutationFn_UploadFile = async (variables: UseMutationUploadFileVariables) => {

    const { ParentLink_Category, ParentLink_RecID, file, progress…

Replies: 4 comments 12 replies

Comment options

You must be logged in to vote
1 reply
@cemcakirlar
Comment options

Comment options

You must be logged in to vote
9 replies
@brockklein
Comment options

@nikhil0o7
Comment options

@brockklein
Comment options

@LucasAndrad
Comment options

@brockklein
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by TkDodo
Comment options

You must be logged in to vote
2 replies
@PixeledCode
Comment options

@thewasif
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
10 participants