endless-jadeE
Refine3y ago
6 replies
endless-jade

useCustomMutation is persisting my headers

so basically I am trying to run mutateAsync function from this hook
and I noticed that after this my axios instance ends up persisting its Content-Type header for every follow up request that has body or data. This function call is overriding my headers. Seems like a bug

        const config = {
            "headers": {
                "Content-Type": 'multipart/form-data;'
            }
        }

        try {
            const { data, } = await mutateAsync({
                url: options?.action,
                method: "patch",
                config,                
                values: formData,
......

when in fact the header should only be for this one off request,
Was this page helpful?