Show notification if unsupported filetype
This commit is contained in:
parent
82d88f50d0
commit
4c9fb07f7d
|
@ -207,10 +207,16 @@ export default defineComponent({
|
|||
|
||||
emit('update:user', changed);
|
||||
if (avatar.value != '')
|
||||
void store.dispatch('user/uploadAvatar', {
|
||||
user: changed,
|
||||
file: avatar.value,
|
||||
});
|
||||
store
|
||||
.dispatch('user/uploadAvatar', {
|
||||
user: changed,
|
||||
file: avatar.value,
|
||||
})
|
||||
.catch((response: Response) => {
|
||||
if (response && response.status == 400) {
|
||||
onAvatarRejected();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function reset() {
|
||||
|
|
|
@ -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