Skip to content
Snippets Groups Projects
Commit df23fd02 authored by elit04's avatar elit04
Browse files

delete 'active' attribute from Boat table (status = active)

parent b241dc76
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,6 @@ const createBoat = async (req: Request, res: Response) => { ...@@ -29,7 +29,6 @@ const createBoat = async (req: Request, res: Response) => {
name: newBoat.name, name: newBoat.name,
boatTypeId: newBoat.boattype, boatTypeId: newBoat.boattype,
status: newBoat.status, status: newBoat.status,
active: newBoat.active,
tags: newBoat.tags, tags: newBoat.tags,
}, },
}); });
...@@ -52,7 +51,6 @@ const showAllBoatsController = async (req: Request, res: Response) => { ...@@ -52,7 +51,6 @@ const showAllBoatsController = async (req: Request, res: Response) => {
name: boat.name, name: boat.name,
boatType: boat.boattype, boatType: boat.boattype,
status: boat.status, status: boat.status,
active: boat.active,
tags: boat.tags, tags: boat.tags,
}; };
}), }),
...@@ -75,7 +73,6 @@ const showBoatById = async (req: Request, res: Response) => { ...@@ -75,7 +73,6 @@ const showBoatById = async (req: Request, res: Response) => {
name: boat.name, name: boat.name,
boatTypeId: boat.boattype, boatTypeId: boat.boattype,
status: boat.status, status: boat.status,
active: boat.active,
tags: boat.tags, tags: boat.tags,
}, },
}); });
......
...@@ -6,7 +6,6 @@ interface BoatAttributes { ...@@ -6,7 +6,6 @@ interface BoatAttributes {
name: string; name: string;
boattype: string; boattype: string;
status: boolean; status: boolean;
active: boolean;
tags: Array<string>; tags: Array<string>;
} }
...@@ -17,7 +16,6 @@ class Boat extends Model<BoatAttributes, BoatTypeInput> implements BoatAttribute ...@@ -17,7 +16,6 @@ class Boat extends Model<BoatAttributes, BoatTypeInput> implements BoatAttribute
declare name: string; declare name: string;
declare boattype: string; declare boattype: string;
declare status: boolean; declare status: boolean;
declare active: boolean;
declare tags: Array<string>; declare tags: Array<string>;
declare readonly createdAt: Date; declare readonly createdAt: Date;
...@@ -49,10 +47,6 @@ export const initBoat = async (sequelizeConnection: Sequelize) => { ...@@ -49,10 +47,6 @@ export const initBoat = async (sequelizeConnection: Sequelize) => {
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
allowNull: false, allowNull: false,
}, },
active: {
type: DataTypes.BOOLEAN,
allowNull: false,
},
tags: { tags: {
type: new DataTypes.ARRAY(DataTypes.STRING), type: new DataTypes.ARRAY(DataTypes.STRING),
} }
......
...@@ -27,7 +27,6 @@ boatsRouter.post( ...@@ -27,7 +27,6 @@ boatsRouter.post(
body("name").not().isEmpty(), body("name").not().isEmpty(),
body("boattype").not().isEmpty(), body("boattype").not().isEmpty(),
body("status").not().isEmpty() && body("status").isIn([1,0]), body("status").not().isEmpty() && body("status").isIn([1,0]),
body("active").not().isEmpty() && body("active").isIn([1,0]),
body("tags").not().isEmpty(), body("tags").not().isEmpty(),
handleValidationResult, handleValidationResult,
validateToken, validateToken,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment