Skip to content
This repository has been archived by the owner on Jan 25, 2025. It is now read-only.

Commit

Permalink
I'm rewriting history
Browse files Browse the repository at this point in the history
  • Loading branch information
tahirmurata committed Sep 26, 2024
1 parent f0c45ef commit 9f3409f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
5 changes: 1 addition & 4 deletions internal/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -759,10 +759,7 @@ func (s *DbService) CountFood(node sqlc.Node) ([]NodeFoodCount, error) {
var foodsList []NodeFoodCount

for _, food := range foods {
foodCountById, err := queries.CountFood(ctx, sqlc.CountFoodParams{
NodeID: pgtype.Int8{Int64: node.ID, Valid: true},
FoodID: pgtype.Int8{Int64: food.ID, Valid: true},
})
foodCountById, err := queries.CountFood(ctx, pgtype.Int8{Int64: food.ID, Valid: true})
if err != nil {
return []NodeFoodCount{}, err
}
Expand Down
12 changes: 3 additions & 9 deletions internal/sqlc/query.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions sql/query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ WHERE node_id = $1;
-- name: CountFood :one
SELECT SUM(quantity)
FROM food_stall_logs
WHERE node_id = $1
AND food_id = $2;
WHERE food_id = $1;
-- name: CountEntryLogTypeByNodeId :one
SELECT COUNT(*)
FROM entry_logs
Expand Down

0 comments on commit 9f3409f

Please sign in to comment.