|
@@ -42,7 +42,10 @@ func (r *allowAndDenyIpRepository) AddAllowAndDenyIps(ctx context.Context, req m
|
|
|
}
|
|
|
|
|
|
func (r *allowAndDenyIpRepository) EditAllowAndDenyIps(ctx context.Context, req model.AllowAndDenyIp) error {
|
|
|
- if err := r.db.WithContext(ctx).Where("id = ?", req.Id).Updates(&req).Error; err != nil {
|
|
|
+ allowAndDenyIp := map[string]interface{}{
|
|
|
+ "allow_or_deny": req.AllowOrDeny,
|
|
|
+ }
|
|
|
+ if err := r.db.WithContext(ctx).Where("id = ?", req.Id).Updates(&req).Updates(allowAndDenyIp).Error; err != nil {
|
|
|
return fmt.Errorf("update error: %v", err)
|
|
|
}
|
|
|
return nil
|