I’m hit a post api with axios my api is working is properly but when i same api useing RKT Query I’m getting a error
"Missing required parameter - file"
This is my api endPoint
addProject:builder.mutation({
query:(data)=>({
url:"/project/add",
method:"POST",
data:data
})
This is my reducer fuction
addProject: (state, action) => {
state.message = action.payload;
},
This is submitHander function
const submitHandler = async (e) => {
try {
e.preventDefault()
// const data = await axios.post("/api/project/add", form);
// console.log(data)
const res = await addProjectFunc(form).unwrap();
dispatch(addProject(form))
console.log(form)
console.log(form)
setForm(initialState)
} catch (error) {
console.log(error)
}
}
New contributor
Ramveer Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.