david
(David Taylor)
November 18, 2019, 4:54pm
4
Ah good . Taking a look through the code, I see this which would cause a 400 error
args[:archetype] = params[:archetype]
args[:participants] = params[:participants] if params[:participants].present? && params[:archetype] == "private_message"
else
args[:category_id] = params[:category_id].to_i if params[:category_id].present?
end
topic.move_posts(current_user, post_ids_including_replies, args)
end
def check_for_status_presence(key, attr)
invalid_param(key) unless %w(pinned pinned_globally visible closed archived).include?(attr)
end
def invalid_param(key)
raise Discourse::InvalidParameters.new(key.to_sym)
end
def fetch_username
params.require(:user)
params[:user]
end
I think you need pinned_globally instead of pinned-globally. Can you try that and see if it works? Looks like that’s a typo in our API documentation - I’ll get it fixed.
Edit: fixed in Correct pinned_globally in topic status documentation · discourse/discourse_api_docs@fcf0d5f · GitHub
5 Likes