mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:21:18 +08:00
support setting category slug
This commit is contained in:
@ -95,6 +95,19 @@ class CategoriesController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def update_slug
|
||||
@category = Category.find(params[:category_id].to_i)
|
||||
guardian.ensure_can_edit!(@category)
|
||||
|
||||
custom_slug = params[:slug].to_s
|
||||
|
||||
if custom_slug.present? && @category.update_attributes(slug: custom_slug)
|
||||
render json: success_json
|
||||
else
|
||||
render_json_error(@category)
|
||||
end
|
||||
end
|
||||
|
||||
def set_notifications
|
||||
category_id = params[:category_id].to_i
|
||||
notification_level = params[:notification_level].to_i
|
||||
|
Reference in New Issue
Block a user