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