modify filter route
continuous-integration/drone/push Build is failing Details

WORK-RHA
Rayhân HASSOU 1 year ago
parent 3254de4433
commit f20a742667

@ -74,7 +74,7 @@ export class IngredientsGateway {
const client = await this.connection.getPoolClient()
const query = {
text: 'SELECT * FROM Ingredients i WHERE LOWER(SUBSTRING(i.name, 1, 1)) = $1',
text: 'SELECT * FROM Ingredients i WHERE LOWER(SUBSTRING(i.name, 1, 1)) = $1 ORDER BY i.name',
values: [letter.toLowerCase()],
};
@ -100,7 +100,7 @@ export class IngredientsGateway {
const client = await this.connection.getPoolClient()
const query = {
text: 'SELECT * FROM Ingredients WHERE LOWER(name) LIKE $1',
text: 'SELECT * FROM Ingredients WHERE LOWER(name) LIKE $1 ORDER BY name',
values: [`%${prompt.toLowerCase()}%`],
};

@ -29,7 +29,7 @@ export class RecipeGateway {
recipes.push(recipe);
}
return recipes
return recipes as Recipe[];
}
async getById(id: number) : Promise<Recipe | null>{
@ -86,6 +86,6 @@ export class RecipeGateway {
}
}
return recipes
return recipes as Recipe[];
}
}
Loading…
Cancel
Save