Rewrite identity and access management
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -41,16 +41,8 @@ type (
|
||||
}
|
||||
|
||||
VendorServices []*VendorService
|
||||
|
||||
ErrVendorServiceNotFound struct {
|
||||
Identifier string
|
||||
}
|
||||
)
|
||||
|
||||
func (e ErrVendorServiceNotFound) Error() string {
|
||||
return fmt.Sprintf("vendor service not found: %s", e.Identifier)
|
||||
}
|
||||
|
||||
func (vs VendorService) CursorKey(orderBy VendorServiceOrderField) page.CursorKey {
|
||||
switch orderBy {
|
||||
case VendorServiceOrderFieldCreatedAt:
|
||||
@@ -101,7 +93,7 @@ LIMIT 1;
|
||||
vendorService, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[VendorService])
|
||||
if err != nil {
|
||||
if errors.Is(err, pgx.ErrNoRows) {
|
||||
return &ErrVendorServiceNotFound{Identifier: vendorServiceID.String()}
|
||||
return ErrResourceNotFound
|
||||
}
|
||||
|
||||
return fmt.Errorf("cannot collect vendor service: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user