taskbar_controller.rb 711 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/
  2. class TaskbarController < ApplicationController
  3. prepend_before_action :authenticate_and_authorize!
  4. before_action :set_task_user_param, only: %i[create update]
  5. def index
  6. model_index_render_result(current_user.taskbars)
  7. end
  8. def show
  9. model_create_render(Taskbar, params)
  10. end
  11. def create
  12. model_create_render(Taskbar, params)
  13. end
  14. def update
  15. model_update_render(Taskbar, params)
  16. end
  17. def destroy
  18. model_destroy_render(Taskbar, params)
  19. end
  20. def init
  21. render json: Taskbar::Init.run(current_user)
  22. end
  23. private
  24. def set_task_user_param
  25. params[:user_id] = current_user.id
  26. end
  27. end