End of evening commit, changing supplier to JSONAPI
This commit is contained in:
@@ -6,13 +6,13 @@ module Suppliers
|
||||
|
||||
def show
|
||||
[current_supplier].include_relations(sections: :tables, product_categories: {products: :product_variants})
|
||||
render json: current_supplier, serializer: Suppliers::SupplierSerializer #.new(current_supplier).as_json
|
||||
render json: JSONAPI::Serializer.serialize(current_supplier, serializer: Suppliers::SupplierSerializer) #.new(current_supplier).as_json
|
||||
end
|
||||
|
||||
def update
|
||||
@supplier = current_supplier
|
||||
current_supplier.update_attributes(supplier_params)
|
||||
render json: Suppliers::SupplierSerializer.new(current_supplier).as_json
|
||||
render json: JSONAPI::Serializer.serialize( current_supplier, serializer: Suppliers::SupplierSerializer)
|
||||
end
|
||||
|
||||
def switch_to
|
||||
|
||||
Reference in New Issue
Block a user