Modified HBForm & HBContest Page

This commit is contained in:
ZacTohZY
2024-07-29 21:26:34 +08:00
parent 34a96a8445
commit a76ec634ca
6 changed files with 203 additions and 129 deletions

View File

@@ -26,6 +26,10 @@ module.exports = (sequelize, DataTypes) => {
type: DataTypes.INTEGER,
allowNull: false
},
avgBill: {
type: DataTypes.DECIMAL(7, 2),
allowNull: false
},
ebPicture: {
type: DataTypes.BLOB("long"),
allowNull: true,

View File

@@ -23,6 +23,7 @@ router.post("/", upload.fields([
waterBill: yup.number().positive().required(),
totalBill: yup.number().positive().required(),
noOfDependents: yup.number().integer().positive().required(),
avgBill: yup.number().positive().required(),
});
try {
data = await validationSchema.validate(data, { abortEarly: false });
@@ -48,6 +49,7 @@ router.get("/", async (req, res) => {
{ waterBill: { [Op.like]: `%${search}%` } },
{ totalBill: { [Op.like]: `%${search}%` } },
{ noOfDependents: { [Op.like]: `%${search}%` } },
{ avgBill: { [Op.like]: `%${search}%` } },
];
}
let list = await HBCform.findAll({