feat(help-center): enable drag-and-drop category reordering (#13706)

This commit is contained in:
Sojan Jose
2026-03-04 23:23:38 -08:00
committed by GitHub
parent 3abe32a2c7
commit 42a244369d
33 changed files with 708 additions and 47 deletions

View File

@@ -73,6 +73,16 @@ class Category < ApplicationRecord
params[:page] || 1
end
def self.update_positions(portal:, positions_hash:)
return if positions_hash.blank?
transaction do
positions_hash.each do |category_id, new_position|
portal.categories.find(category_id).update!(position: new_position)
end
end
end
private
def ensure_account_id