Commit ca5b50f3 authored by Tình Trương's avatar Tình Trương

update

parent 561ea8e3
......@@ -28,15 +28,13 @@ export type BaseResponseBody<T> = {
data: T;
};
export default boot(({ app, store }) => {
export default boot<StateInterface>(({ app, store }) => {
// for use inside Vue files (Options API) through this.$axios and this.$api
const $store = store as Store<StateInterface>;
const onRequest = (axiosConfig: AxiosRequestConfig) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
axiosConfig.headers.Authorization = `Bearer ${
$store.state.authentication.token || ''
store.state.authentication.token || ''
}`;
if (axiosConfig.method?.toUpperCase() === 'GET') {
......@@ -69,6 +67,7 @@ export default boot(({ app, store }) => {
type: 'warning',
message: i18n.global.t('tokenInvalidMessage'),
});
void store.dispatch('authentication/logOut');
// ... Logout
} else {
Notify.create({
......
......@@ -84,7 +84,7 @@
:label="$t('managingUnit.dialogLabel.fieldLabels.fields')"
:options="fieldsOptions"
:rules="fieldsRules"
emit-value
multiple
map-options
option-value="id"
option-label="name"
......@@ -506,8 +506,8 @@ export default defineComponent({
const addNewArtist = () => {
const newArtistList = [...props.artistList];
newArtistList.push({
contractFrom: contractTimeFrom.value,
contractTo: contractTimeTo.value,
contractFrom: `${contractTimeFrom.value} 00:00:00`,
contractTo: `${contractTimeTo.value} 00:00:00`,
timeAdd: `${contractTimeFrom.value} - ${contractTimeTo.value}`,
status: artistStatus.value,
artistId: artistName.value?.id,
......
......@@ -384,7 +384,7 @@ export default defineComponent({
phoneNumber: unitPhoneNumber.value,
status: unitStatus.value ? 1 : 2,
fields: unitField.value,
artistList: unitArtistList.value,
contracts: unitArtistList.value,
};
const response = (await api({
url: API_PATHS.artistOwnerAdd,
......@@ -392,6 +392,7 @@ export default defineComponent({
data,
})) as AxiosResponse<BaseResponseBody<ArtistOwnerAdd[]>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
addUnitDialogIsOpened.value = false;
Notify.create({
type: 'positive',
message: i18n.global.t(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment