2016-10-19 03:11:36 +00:00
|
|
|
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
|
2015-11-16 10:44:13 +00:00
|
|
|
|
|
|
|
class ChatsController < ApplicationController
|
2017-02-15 12:29:25 +00:00
|
|
|
prepend_before_action { authentication_check(permission: 'admin.chat') }
|
2015-11-16 10:44:13 +00:00
|
|
|
|
|
|
|
def index
|
|
|
|
chat_ids = []
|
|
|
|
assets = {}
|
2016-06-30 20:04:48 +00:00
|
|
|
Chat.order(:id).each { |chat|
|
2015-11-16 10:44:13 +00:00
|
|
|
chat_ids.push chat.id
|
|
|
|
assets = chat.assets(assets)
|
|
|
|
}
|
2015-11-25 22:24:08 +00:00
|
|
|
setting = Setting.find_by(name: 'chat')
|
|
|
|
assets = setting.assets(assets)
|
2015-11-16 10:44:13 +00:00
|
|
|
render json: {
|
|
|
|
chat_ids: chat_ids,
|
|
|
|
assets: assets,
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
|
|
|
model_show_render(Chat, params)
|
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
|
|
|
model_create_render(Chat, params)
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
|
|
|
model_update_render(Chat, params)
|
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
2016-11-30 10:30:03 +00:00
|
|
|
model_destroy_render(Chat, params)
|
2015-11-16 10:44:13 +00:00
|
|
|
end
|
2016-08-12 16:39:09 +00:00
|
|
|
|
2015-11-16 10:44:13 +00:00
|
|
|
end
|