change unknown query params to
This commit is contained in:
parent
fa4561d90b
commit
79977f1a18
1
internal/application/models.go
Normal file
1
internal/application/models.go
Normal file
|
@ -0,0 +1 @@
|
||||||
|
package application
|
|
@ -46,7 +46,7 @@ func (d *Database) FindClaimsByProductID(product_id int) (claims []models.Claim,
|
||||||
SELECT "automated" as cluster, id, product_id, worker_type, null as evidence_type, evidence, unnest(counter_claim) as category, false as polarity, created_at, null as created_by FROM automated_claims
|
SELECT "automated" as cluster, id, product_id, worker_type, null as evidence_type, evidence, unnest(counter_claim) as category, false as polarity, created_at, null as created_by FROM automated_claims
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
WHERE product_id = ?
|
WHERE product_id = $1
|
||||||
)
|
)
|
||||||
WHERE rn = 1
|
WHERE rn = 1
|
||||||
ORDER BY created_at;
|
ORDER BY created_at;
|
||||||
|
@ -63,7 +63,7 @@ func (database *Database) FindUserClaimById(claim_id int) (*UserClaim, error) {
|
||||||
|
|
||||||
var claim UserClaim
|
var claim UserClaim
|
||||||
|
|
||||||
err := database.db.QueryOne(ctx, claim, "FROM user_claims WHERE id = ?", claim_id)
|
err := database.db.QueryOne(ctx, claim, "FROM user_claims WHERE id = $1", claim_id)
|
||||||
|
|
||||||
if err == ksql.ErrRecordNotFound {
|
if err == ksql.ErrRecordNotFound {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in a new issue