Fix missing common_third_party_id in vendor queries
LoadByID and LoadByIDs used 4-space indentation and were missed by the bulk column addition. The struct field existed but the SELECT did not return it, causing pgx scan failures. Signed-off-by: Émile Ré <emile@getprobo.com> Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -205,7 +205,7 @@ SELECT
|
|||||||
id,
|
id,
|
||||||
tenant_id,
|
tenant_id,
|
||||||
organization_id,
|
organization_id,
|
||||||
common_third_party_id,
|
common_third_party_id,
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
category,
|
category,
|
||||||
@@ -272,7 +272,7 @@ SELECT
|
|||||||
id,
|
id,
|
||||||
tenant_id,
|
tenant_id,
|
||||||
organization_id,
|
organization_id,
|
||||||
common_third_party_id,
|
common_third_party_id,
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
category,
|
category,
|
||||||
@@ -1316,7 +1316,7 @@ ORDER BY name ASC
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *Vendor) LoadByOrganizationIDAndCommonThirdPartyID(
|
func (v *ThirdParty) LoadByOrganizationIDAndCommonThirdPartyID(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
conn pg.Querier,
|
conn pg.Querier,
|
||||||
scope Scoper,
|
scope Scoper,
|
||||||
@@ -1375,7 +1375,7 @@ LIMIT 1;
|
|||||||
}
|
}
|
||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
|
|
||||||
vendor, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Vendor])
|
vendor, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ThirdParty])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, pgx.ErrNoRows) {
|
if errors.Is(err, pgx.ErrNoRows) {
|
||||||
return ErrResourceNotFound
|
return ErrResourceNotFound
|
||||||
|
|||||||
Reference in New Issue
Block a user