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