taskbar_controller.rb 706 B

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright (C) 2012-2024 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. current_user_tasks = Taskbar.where(user_id: current_user.id)
  7. model_index_render_result(current_user_tasks)
  8. end
  9. def show
  10. model_create_render(Taskbar, params)
  11. end
  12. def create
  13. model_create_render(Taskbar, params)
  14. end
  15. def update
  16. model_update_render(Taskbar, params)
  17. end
  18. def destroy
  19. model_destroy_render(Taskbar, params)
  20. end
  21. private
  22. def set_task_user_param
  23. params[:user_id] = current_user.id
  24. end
  25. end