Show notification if unsupported filetype
This commit is contained in:
parent
82d88f50d0
commit
4c9fb07f7d
|
@ -207,9 +207,15 @@ export default defineComponent({
|
|||
|
||||
emit('update:user', changed);
|
||||
if (avatar.value != '')
|
||||
void store.dispatch('user/uploadAvatar', {
|
||||
store
|
||||
.dispatch('user/uploadAvatar', {
|
||||
user: changed,
|
||||
file: avatar.value,
|
||||
})
|
||||
.catch((response: Response) => {
|
||||
if (response && response.status == 400) {
|
||||
onAvatarRejected();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Module, MutationTree, ActionTree, GetterTree } from 'vuex';
|
||||
import { StateInterface } from 'src/store';
|
||||
import { axios } from 'boot/axios';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import { AxiosError, AxiosResponse } from 'axios';
|
||||
import { SessionStorage } from 'quasar';
|
||||
import { CurrentUserResponse } from 'src/plugins/user/models';
|
||||
|
||||
|
@ -129,6 +129,9 @@ const actions: ActionTree<UserStateInterface, StateInterface> = {
|
|||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
.catch((error: AxiosError) => {
|
||||
return Promise.reject(error.response);
|
||||
})
|
||||
.finally(() => {
|
||||
commit('setLoading', false);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue