2026-01-02 13:41:09 +00:00
|
|
|
# Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
2020-09-08 15:06:23 +00:00
|
|
|
|
|
|
|
|
class DataPrivacyTasksController < ApplicationController
|
2023-03-19 20:43:36 +00:00
|
|
|
prepend_before_action :authenticate_and_authorize!
|
2020-09-08 15:06:23 +00:00
|
|
|
|
|
|
|
|
def index
|
|
|
|
|
model_index_render(DataPrivacyTask, params)
|
|
|
|
|
end
|
|
|
|
|
|
2024-12-13 15:41:47 +00:00
|
|
|
def by_state
|
|
|
|
|
scope = DataPrivacyTask.reorder('id DESC').limit(500)
|
|
|
|
|
|
2026-03-19 10:46:09 +00:00
|
|
|
in_process = scope.in_process
|
|
|
|
|
failed = scope.failed
|
|
|
|
|
completed = scope.completed
|
2024-12-13 15:41:47 +00:00
|
|
|
|
|
|
|
|
assets = ApplicationModel::CanAssets.reduce [in_process, failed, completed].flatten, {}
|
|
|
|
|
|
|
|
|
|
render json: {
|
|
|
|
|
record_ids: {
|
|
|
|
|
in_process: in_process.pluck(:id),
|
|
|
|
|
failed: failed.pluck(:id),
|
|
|
|
|
completed: completed.pluck(:id)
|
|
|
|
|
},
|
|
|
|
|
assets: assets,
|
|
|
|
|
}, status: :ok
|
|
|
|
|
end
|
|
|
|
|
|
2020-09-08 15:06:23 +00:00
|
|
|
def show
|
|
|
|
|
model_show_render(DataPrivacyTask, params)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def create
|
|
|
|
|
model_create_render(DataPrivacyTask, params)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def update
|
|
|
|
|
model_update_render(DataPrivacyTask, params)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
|
model_destroy_render(DataPrivacyTask, params)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|