aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/customer/validators.go
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2025-10-11 20:55:48 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2025-10-11 20:55:48 +0530
commitbc154857fb5569d7c1fa9785cc891cb927a6a156 (patch)
tree590c9f6a00a1b97b2ee45cfa5a767558089affe0 /customer/validators.go
parent8a47978ca17d2f251d67d12b0e34fa26bb1e4ace (diff)
removed per-user itemsv0.17.0
Diffstat (limited to 'customer/validators.go')
-rw-r--r--customer/validators.go26
1 files changed, 0 insertions, 26 deletions
diff --git a/customer/validators.go b/customer/validators.go
index b8c2a14..5693116 100644
--- a/customer/validators.go
+++ b/customer/validators.go
@@ -62,29 +62,3 @@ func (c *Customer) validate() error {
return nil
}
-
-func checkCustomerOwnership(customerId, userId uint) error {
- var customer Customer
- err := db.
- Select("id", "user_id").
- Where("id = ?", customerId).
- Find(&customer).
- Error
-
- // TODO: handle potential errors
- if err != nil {
- return err
- }
-
- // customer doesn't exist
- if customer.ID == 0 {
- return errors.ErrNotFound
- }
-
- // user doesn't own this customer
- if customer.UserID != userId {
- return errors.ErrForbidden
- }
-
- return nil
-}