more
This commit is contained in:
@@ -97,7 +97,21 @@ const Vehicles = () => {
|
||||
const model = inputs.Model;
|
||||
const trim = inputs.Trim;
|
||||
const color = inputs.Color;
|
||||
if (!make || !model || !trim || !color) {
|
||||
const year = inputs["Prod Year"];
|
||||
const cat = inputs.Category;
|
||||
const miles = inputs.Mileage;
|
||||
const price = inputs["Pre-QRV-Price"];
|
||||
|
||||
if (
|
||||
!make ||
|
||||
!model ||
|
||||
!trim ||
|
||||
!color ||
|
||||
!year ||
|
||||
!cat ||
|
||||
!miles ||
|
||||
!price
|
||||
) {
|
||||
setAlert("Please fill out all fields");
|
||||
return false;
|
||||
}
|
||||
@@ -108,7 +122,10 @@ const Vehicles = () => {
|
||||
e.preventDefault();
|
||||
//format(e);
|
||||
const valid = validate();
|
||||
if (valid) {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
console.log("inputs~~~~~~~~~~", inputs);
|
||||
setSavedVehicles([...savedVehicles, inputs]);
|
||||
try {
|
||||
const docRef = await addDoc(collection(db, "hdepot"), inputs);
|
||||
@@ -119,7 +136,6 @@ const Vehicles = () => {
|
||||
console.log(`Error saving vehicle to db: ${error}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteData(e) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user