diff options
Diffstat (limited to 'customer/validators.go')
| -rw-r--r-- | customer/validators.go | 26 | 
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 -}  |