summaryrefslogtreecommitdiff
path: root/app/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/products_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/api/products_controller.rb b/app/controllers/api/products_controller.rb
index 59019d0..838a38a 100644
--- a/app/controllers/api/products_controller.rb
+++ b/app/controllers/api/products_controller.rb
@@ -68,7 +68,7 @@ module Api
end
def object_params
- categories = permitted_params[:categories].split(',')
+ categories = permitted_params[:categories]&.split(',')
public_id = SecureRandom.hex(12)
public_id = SecureRandom.hex(12) while Product.exists?(public_id:)
permitted_params.merge(categories:, public_id:)