formatted query in FindClaimsByProductID

This commit is contained in:
Leyla Becker 2025-04-21 18:54:50 -05:00
parent 4ebc663d3b
commit 43c183c29a

View file

@ -7,7 +7,9 @@ import (
func (database *Database) FindClaimsByProductID(product_id int) (claims []models.Claim, err error) {
ctx := context.Background()
err = database.db.Query(ctx, claims, `SELECT
err = database.db.Query(ctx, claims, `
SELECT
cluster,
id,
worker_type,
@ -47,6 +49,7 @@ FROM (
WHERE rn = 1
ORDER BY created_at;
`, product_id)
if err != nil {
return claims, err
}