Update templates
This commit is contained in:
parent
975dd39ec8
commit
0861968e16
4 changed files with 21 additions and 3 deletions
18
app/views/api/v1/api/errors.json.rabl
Normal file
18
app/views/api/v1/api/errors.json.rabl
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
object false
|
||||
|
||||
node :errors do
|
||||
if @exception.respond_to?(:record)
|
||||
errors = ValidationErrorsSerializer.new(@exception.record).serialize
|
||||
end
|
||||
|
||||
if @exception.respond_to?(:message) && @exception.respond_to?(:code)
|
||||
errors = [
|
||||
{
|
||||
message: @exception.message,
|
||||
code: @exception.code
|
||||
}
|
||||
]
|
||||
end
|
||||
|
||||
errors
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
object :party
|
||||
|
||||
attributes :id, :shortcode
|
||||
attributes :id, :user_id, :shortcode
|
||||
|
||||
node :grid do |p|
|
||||
partial('grid_weapons/base', :object => p.weapons)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
object false
|
||||
|
||||
child(@user) {
|
||||
attributes :id, :email, :username
|
||||
node(:user) {
|
||||
@presenter
|
||||
} unless @user.blank?
|
||||
|
||||
node(:error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue