Skip to content

Commit

Permalink
fix(meals): sort menus by the most recent update time
Browse files Browse the repository at this point in the history
  • Loading branch information
czaja307 committed Jan 16, 2025
1 parent 8345413 commit 084e509
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions app/controllers/meals_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ export default class MealsController {
const limit = request.input("limit", 10) as number;

const hashes = await HashesMeal.query()
.distinct("hashFk")
.orderBy("createdAt", "desc")
.preload("websiteHash")
.orderBy("updatedAt", "desc")
.paginate(page, limit);

const meals = await Promise.all(
Expand Down
1 change: 0 additions & 1 deletion scripts/menu_scrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export async function scrapeMenu() {
export async function cacheMenu() {
const response = await fetch(url);
const data = await response.text();
console.log(data);
return createHash("sha256").update(data).digest("hex");
}

Expand Down

0 comments on commit 084e509

Please sign in to comment.