From bc154857fb5569d7c1fa9785cc891cb927a6a156 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sat, 11 Oct 2025 20:55:48 +0530 Subject: removed per-user items --- customer/validators.go | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'customer/validators.go') 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 -} -- cgit v1.2.3