diff --git a/data/static/codefixes/dbSchemaChallenge_1.ts b/data/static/codefixes/dbSchemaChallenge_1.ts index 2a0949b4530..f4a5b31c140 100644 --- a/data/static/codefixes/dbSchemaChallenge_1.ts +++ b/data/static/codefixes/dbSchemaChallenge_1.ts @@ -5,9 +5,9 @@ module.exports = function searchProducts () { models.sequelize.query("SELECT * FROM Products WHERE ((name LIKE '%"+criteria+"%' OR description LIKE '%"+criteria+"%') AND deletedAt IS NULL) ORDER BY name") .then(([products]: any) => { const dataString = JSON.stringify(products) - for (let i = 0; i < products.length; i++) { - products[i].name = req.__(products[i].name) - products[i].description = req.__(products[i].description) + for (const product of products) { + product.name = req.__(product.name) + product.description = req.__(product.description) } res.json(utils.queryResultToJson(products)) }).catch((error: ErrorWithParent) => {