Update AddArtist.ts

parent a7ebee48
......@@ -656,95 +656,95 @@ export default defineComponent({
} catch (error) {}
};
const checkValidate = () => {
// let hasError = false;
// if (!avatarFile.value) {
// hasError = true;
// hidden_img.value = true;
// }
// if (!artistCode.value || !artistCode.value?.trim().length) {
// hasError = true;
// artistCodeRules.value = true;
// }
// if (!fullName.value || !fullName.value?.trim().length) {
// hasError = true;
// fullNameRules.value = true;
// }
// if (!artistName.value || !artistName.value?.trim().length) {
// hasError = true;
// artistNameRules.value = true;
// }
// if (address.value) {
// hasError = true;
// addressRules.value = true;
// }
// if (!birthday.value || !birthday.value?.trim().length) {
// hasError = true;
// birthdayRules.value = true;
// }
// if (sex.value === null) {
// hasError = true;
// sexRules.value = true;
// }
// if (!phoneNumber.value || !phoneNumber.value?.trim().length) {
// hasError = true;
// phoneNumberRules.value = true;
// errorMessPhoneNumber.value = i18n.global.t(
// 'artist.artistInformation.validateMessages.requirePhoneNumber'
// );
// }
// if (!email.value || !email.value?.trim().length) {
// hasError = true;
// emailRules.value = true;
// errorMessEmail.value = i18n.global.t(
// 'artist.artistInformation.validateMessages.requireEmail'
// );
// }
// if (
// (!mnBookingPhone.value || !mnBookingPhone.value?.trim().length) &&
// check_infoBooking.value
// ) {
// hasError = true;
// mnBookingPhoneRules.value = true;
// errorMessmnBookingPhone.value = i18n.global.t(
// 'artist.artistInformation.validateMessages.requirePhoneNumberAdminister'
// );
// }
// if (
// (!mnBookingEmail.value || !mnBookingEmail.value?.trim().length) &&
// check_infoBooking.value
// ) {
// hasError = true;
// mnBookingEmailRules.value = true;
// errorMessmnBookingEmail.value = i18n.global.t(
// 'artist.artistInformation.validateMessages.requireEmailAdminister'
// );
// }
// if (artistLevel.value === null) {
// hasError = true;
// artistLevelRules.value = true;
// }
// if (!fields.value) {
// hasError = true;
// fieldRules.value = true;
// }
// if (nationality.value === null) {
// hasError = true;
// nationalityRules.value = true;
// }
// if (qualification.value === null) {
// hasError = true;
// qualificationRules.value = true;
// }
// if (!works.value.length) {
// hasError = true;
// workRules.value = true;
// }
// if (hasError === false) {
let hasError = false;
if (!avatarFile.value) {
hasError = true;
hidden_img.value = true;
}
if (!artistCode.value || !artistCode.value?.trim().length) {
hasError = true;
artistCodeRules.value = true;
}
if (!fullName.value || !fullName.value?.trim().length) {
hasError = true;
fullNameRules.value = true;
}
if (!artistName.value || !artistName.value?.trim().length) {
hasError = true;
artistNameRules.value = true;
}
if (address.value) {
hasError = true;
addressRules.value = true;
}
if (!birthday.value || !birthday.value?.trim().length) {
hasError = true;
birthdayRules.value = true;
}
if (sex.value === null) {
hasError = true;
sexRules.value = true;
}
if (!phoneNumber.value || !phoneNumber.value?.trim().length) {
hasError = true;
phoneNumberRules.value = true;
errorMessPhoneNumber.value = i18n.global.t(
'artist.artistInformation.validateMessages.requirePhoneNumber'
);
}
if (!email.value || !email.value?.trim().length) {
hasError = true;
emailRules.value = true;
errorMessEmail.value = i18n.global.t(
'artist.artistInformation.validateMessages.requireEmail'
);
}
if (
(!mnBookingPhone.value || !mnBookingPhone.value?.trim().length) &&
check_infoBooking.value
) {
hasError = true;
mnBookingPhoneRules.value = true;
errorMessmnBookingPhone.value = i18n.global.t(
'artist.artistInformation.validateMessages.requirePhoneNumberAdminister'
);
}
if (
(!mnBookingEmail.value || !mnBookingEmail.value?.trim().length) &&
check_infoBooking.value
) {
hasError = true;
mnBookingEmailRules.value = true;
errorMessmnBookingEmail.value = i18n.global.t(
'artist.artistInformation.validateMessages.requireEmailAdminister'
);
}
if (artistLevel.value === null) {
hasError = true;
artistLevelRules.value = true;
}
if (!fields.value) {
hasError = true;
fieldRules.value = true;
}
if (nationality.value === null) {
hasError = true;
nationalityRules.value = true;
}
if (qualification.value === null) {
hasError = true;
qualificationRules.value = true;
}
if (!works.value.length) {
hasError = true;
workRules.value = true;
}
if (hasError === false) {
void addArtist();
// }
}
};
const addArtist = async () => {
try {
......
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