Car table update (#27)

This commit is contained in:
John Wu
2021-04-05 10:09:40 -07:00
committed by GitHub
parent 17f81822c0
commit 113cc97fea
5 changed files with 7 additions and 15 deletions

View File

@@ -222,7 +222,7 @@ describe("UpdatesContext", () => {
data-testid="with-bad-data"
onClick={async () => {
result = await exec(
{ package_id: 1, car_ids: [] },
{ package_id: 1, vins: [] },
TEST_AUTH_OBJECT
);
}}
@@ -233,7 +233,7 @@ describe("UpdatesContext", () => {
result = await exec(
{
package_id: 1,
car_ids: [1, 2, 3],
vins: ["FISKER123", "FISKER124", "FISKER125"],
},
TEST_AUTH_OBJECT
);
@@ -284,7 +284,7 @@ describe("UpdatesContext", () => {
checkState("false", "", {
id: 1,
package_id: 1,
car_ids: [1, 2, 3],
vins: ["FISKER123", "FISKER124", "FISKER125"],
});
});
});

View File

@@ -125,7 +125,7 @@ const validateCreateCarUpdates = (data) => {
throw new Error("Package id required");
}
if (!data.car_ids || data.car_ids.length === 0) {
if (!data.vins || data.vins.length === 0) {
throw new Error("Car ids required");
}
};