update

parent 2aad3d47
......@@ -115,8 +115,8 @@ export default defineComponent({
const qualification: Ref<QualificationType | null> = ref(null);
const artistLevel: Ref<ArtistLevelType | null> = ref(null);
const status: Ref<number> = ref(1);
const fields: Ref<FieldType | null> = ref(null);
const fieldsPrivate: Ref<FieldType | null> = ref(null);
const fields: Ref<FieldType[]> = ref([]);
const fieldsPrivate: Ref<FieldType[]> = ref([]);
const works: Ref<WorkType[]> = ref([]);
const phoneNumber: Ref<string | null> = ref(null);
const email: Ref<string | null> = ref(null);
......@@ -195,9 +195,9 @@ export default defineComponent({
(value) => {
if (value !== null) {
if (value === fieldsPrivate.value) {
void getWorkOptions();
// void getWorkOptions();
} else {
void getWorkOptions();
// void getWorkOptions();
works.value = [];
}
} else {
......@@ -393,9 +393,9 @@ export default defineComponent({
works.value = ArtistInformation.works;
artistLevel.value = ArtistInformation.artistLevel;
sex.value = ArtistInformation.sex;
fields.value = ArtistInformation.fields[0];
fields.value = ArtistInformation.fields;
fieldsPrivate.value = ArtistInformation.fields[0];
fieldsPrivate.value = ArtistInformation.fields;
bankAccounts.value = ArtistInformation.bankAccounts;
products.value = ArtistInformation.products;
......@@ -448,18 +448,18 @@ export default defineComponent({
professionOptions.value = response.data.data;
}
};
const getWorkOptions = async () => {
const response = (await api({
url: API_PATHS.getWorkOptions,
method: 'GET',
params: {
fieldId: fields.value?.id,
},
})) as AxiosResponse<BaseResponseBody<WorkType[]>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
workOptions.value = response.data.data;
}
};
// const getWorkOptions = async () => {
// const response = (await api({
// url: API_PATHS.getWorkOptions,
// method: 'GET',
// params: {
// fieldId: fields.value?.id,
// },
// })) as AxiosResponse<BaseResponseBody<WorkType[]>>;
// if (response.data.error.code === config.API_RES_CODE.OK.code) {
// workOptions.value = response.data.data;
// }
// };
const getProvinceOptions = async () => {
const response = (await api({
......@@ -917,7 +917,7 @@ export default defineComponent({
artistLevel: artistLevel.value,
// fields: fields.value === null ? [] : [fields.value],
// fields: fields.value === null ? [] : [fields.value],
fields: [],
fields: fields.value,
nationality: nationality.value,
qualification: qualification.value,
works: works.value,
......@@ -1020,7 +1020,7 @@ export default defineComponent({
getNationalityOptions,
getArtistLevelOptions,
getQualificationOptions,
getWorkOptions,
// getWorkOptions,
getMusicTypeOptions,
bankAccounts,
products,
......
......@@ -151,40 +151,44 @@ export default defineComponent({
} catch (error) {}
};
// const confirmDelete = (id: number) => {
// Dialog.create({
// title: i18n.global.t(
// 'artist.bankAccount.confirmActionsTitle.confirmDeleteAccBankTitle'
// ),
// message: i18n.global.t(
// 'postCategory.confirmActionsTitle.confirmDeletePostCategory'
// ),
// cancel: i18n.global.t(
// 'artist.bankAccount.confirmActionsTitle.confirmDeleteAccBankBtnLabel'
// ),
// color: 'negative',
// }).onOk(async () => {
// try {
// const response = (await api({
// url: API_PATHS.deleteCategoryPost,
// method: 'GET',
// params: {
// id: id,
// },
// })) as AxiosResponse<BaseResponseBody<unknown>>;
// if (response.data.error.code === config.API_RES_CODE.OK.code) {
// Notify.create({
// type: 'positive',
// message: i18n.global.t(
// 'postCategory.actionMessages.deletePostCategoryAccess'
// ),
// actions: [{ icon: 'close', color: 'white' }],
// });
// void getListCategoryPost();
// }
// } catch (error) {}
// });
// };
const confirmDelete = (id: number) => {
Dialog.create({
title: i18n.global.t(
'artist.bankAccount.confirmActionsTitle.confirmDeleteAccBankTitle'
),
message: i18n.global.t(
'postCategory.confirmActionsTitle.confirmDeletePostCategory'
),
cancel: i18n.global.t(
'artist.bankAccount.confirmActionsTitle.confirmDeleteAccBankBtnLabel'
),
color: 'negative',
}).onOk(() => {
void deletePost(id);
});
};
const deletePost = async (id: number) => {
try {
const response = (await api({
url: API_PATHS.deleteCategoryPost,
method: 'GET',
params: {
id: id,
},
})) as AxiosResponse<BaseResponseBody<unknown>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
Notify.create({
type: 'positive',
message: i18n.global.t(
'postCategory.actionMessages.deletePostCategoryAccess'
),
actions: [{ icon: 'close', color: 'white' }],
});
void getListCategoryPost();
}
} catch (error) {}
};
const openUpdateDialog = async (id: number) => {
await getDetailCategoryPost(id);
isOpenUpdateDialog.value = true;
......@@ -247,7 +251,7 @@ export default defineComponent({
getLanguages,
languages,
addPostCategory,
// confirmDelete,
confirmDelete,
openUpdateDialog,
detailPostCategory,
updatePostCategory,
......
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