From 4ed2b53805a42963e2642a2802252f262e6e2068 Mon Sep 17 00:00:00 2001 From: Joran Kikke Date: Tue, 9 Apr 2024 09:14:41 +1200 Subject: [PATCH] Only require needed params --- lib/discourse_api/api/categories.rb | 4 +++- spec/spec_helper.rb | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/discourse_api/api/categories.rb b/lib/discourse_api/api/categories.rb index 0437f15..c9f9b69 100644 --- a/lib/discourse_api/api/categories.rb +++ b/lib/discourse_api/api/categories.rb @@ -9,8 +9,10 @@ def create_category(args = {}) args = API .params(args) - .required(:name, :color, :text_color) + .required(:name) .optional( + :color, + :text_color, :slug, :permissions, :auto_close_hours, diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 945b626..c4f2aee 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,6 +9,7 @@ require "discourse_api" require "rspec" require "webmock/rspec" +require "ostruct" RSpec.configure do |config| config.expect_with :rspec do |c|