2026-01-02 13:41:09 +00:00
|
|
|
# Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
2013-06-12 15:59:58 +00:00
|
|
|
|
2013-05-29 15:11:11 +00:00
|
|
|
class TaskbarController < ApplicationController
|
2023-03-19 20:43:36 +00:00
|
|
|
prepend_before_action :authenticate_and_authorize!
|
2013-05-29 15:11:11 +00:00
|
|
|
|
2020-03-19 09:39:51 +00:00
|
|
|
before_action :set_task_user_param, only: %i[create update]
|
|
|
|
|
|
2013-05-29 15:11:11 +00:00
|
|
|
def index
|
2025-03-07 10:41:48 +00:00
|
|
|
model_index_render_result(current_user.taskbars)
|
2013-05-29 15:11:11 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def show
|
2017-09-10 16:19:03 +00:00
|
|
|
model_create_render(Taskbar, params)
|
2013-05-29 15:11:11 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def create
|
2015-04-27 14:53:29 +00:00
|
|
|
model_create_render(Taskbar, params)
|
2013-05-29 15:11:11 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def update
|
2017-09-10 16:19:03 +00:00
|
|
|
model_update_render(Taskbar, params)
|
2013-05-29 15:11:11 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def destroy
|
2017-09-10 16:19:03 +00:00
|
|
|
model_destroy_render(Taskbar, params)
|
2013-05-29 15:11:11 +00:00
|
|
|
end
|
2013-05-31 23:09:09 +00:00
|
|
|
|
2025-03-07 10:41:48 +00:00
|
|
|
def init
|
|
|
|
|
render json: Taskbar::Init.run(current_user)
|
|
|
|
|
end
|
|
|
|
|
|
2013-05-31 23:09:09 +00:00
|
|
|
private
|
2015-04-27 20:49:17 +00:00
|
|
|
|
2020-03-19 09:39:51 +00:00
|
|
|
def set_task_user_param
|
2017-09-10 16:19:03 +00:00
|
|
|
params[:user_id] = current_user.id
|
|
|
|
|
end
|
2013-05-29 15:11:11 +00:00
|
|
|
end
|