Moved the mobile location validation rule definition to page level

This commit is contained in:
Leah Schumann 2023-04-07 09:53:12 -04:00
parent 52061134da
commit a1f818ccd6
2 changed files with 18 additions and 15 deletions

View file

@ -73,21 +73,6 @@ import {
// Validation
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 {
name: "mobile-location-modal-questions",

View file

@ -100,6 +100,24 @@ import {
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
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 {
name: "service-location",
data() {