Answer the question
In order to leave comments, you need to log in
How to track the type parameter of a function from mapAction?
There is a method updatePhoto
that is taken from the store through macActions
. It contains the type of parameter FormData
actions.ts
async updatePhoto(data: FormData): Promise<void> {
try {
await userHttpService.uploadPhoto(data);
} catch (ex) {
throw new Error(ex);
}
}
public updatePhoto;
public async uploadPhoto(file) {
try {
const formData = new FormData();
formData.append('avatar', file);
await this.updatePhoto(formData);
} catch (e) {
console.log(e);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question