Moved the mobile location validation rule definition to page level
This commit is contained in:
parent
52061134da
commit
a1f818ccd6
2 changed files with 18 additions and 15 deletions
|
|
@ -73,21 +73,6 @@ import {
|
||||||
|
|
||||||
// Validation
|
// Validation
|
||||||
import { useField } from "vee-validate";
|
import { useField } from "vee-validate";
|
||||||
import { defineRule } from "vee-validate";
|
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
|
||||||
|
|
||||||
defineRule("mobile-location-required", (value) => {
|
|
||||||
if (
|
|
||||||
value.addressQuestions.streetAddress == "" ||
|
|
||||||
value.addressQuestions.city == "" ||
|
|
||||||
value.addressQuestions.state == "" ||
|
|
||||||
value.addressQuestions.zipCode == "" ||
|
|
||||||
value.isVehicleProtected == null
|
|
||||||
) {
|
|
||||||
return errorMessages.MOBILE_LOCATION_REQUIRED;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "mobile-location-modal-questions",
|
name: "mobile-location-modal-questions",
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,24 @@ import {
|
||||||
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
|
||||||
|
// Validation
|
||||||
|
import { defineRule } from "vee-validate";
|
||||||
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
|
|
||||||
|
// DEFINE VALIDATION RULES
|
||||||
|
defineRule("mobile-location-required", (value) => {
|
||||||
|
if (
|
||||||
|
value.addressQuestions.streetAddress == "" ||
|
||||||
|
value.addressQuestions.city == "" ||
|
||||||
|
value.addressQuestions.state == "" ||
|
||||||
|
value.addressQuestions.zipCode == "" ||
|
||||||
|
value.isVehicleProtected == null
|
||||||
|
) {
|
||||||
|
return errorMessages.MOBILE_LOCATION_REQUIRED;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "service-location",
|
name: "service-location",
|
||||||
data() {
|
data() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue