overview_sortings_controller.rb 825 B

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class User::OverviewSortingsController < ApplicationController
  3. include CanPrioritize
  4. prepend_before_action { authentication_check && authorize! }
  5. def index
  6. render json: {
  7. overviews: Ticket::Overviews.all(current_user: current_user),
  8. overview_sortings: User::OverviewSorting.where(user: current_user),
  9. }
  10. end
  11. def show
  12. model_show_render(User::OverviewSorting, params)
  13. end
  14. def create
  15. model_create_render(User::OverviewSorting, params)
  16. end
  17. def update
  18. model_update_render(User::OverviewSorting, params)
  19. end
  20. def destroy
  21. model_destroy_render(User::OverviewSorting, params)
  22. end
  23. def prio_find(entry_prio)
  24. klass.find_by(overview_id: entry_prio[0], user: current_user)
  25. end
  26. end