Sha256: 1a7aaa31893cd6384d3d9e7b5c37d9e755c87ed8ec2766bd0ec59dda00f4a91c
Contents?: true
Size: 1.12 KB
Versions: 40
Compression:
Stored size: 1.12 KB
Contents
# frozen_string_literal: true require 'dato/site/repo/base' module Dato module Site module Repo class ItemType < Base def create(resource_attributes) body = JsonApiSerializer.new( type: :item_type, attributes: %i(api_key name singleton sortable), required_attributes: %i(api_key name singleton sortable) ).serialize(resource_attributes) post_request '/item-types', body end def update(item_type_id, resource_attributes) body = JsonApiSerializer.new( type: :item_type, attributes: %i(api_key name singleton sortable), required_attributes: %i(api_key name singleton sortable) ).serialize(resource_attributes, item_type_id) put_request "/item-types/#{item_type_id}", body end def all get_request '/item-types' end def find(item_type_id) get_request "/item-types/#{item_type_id}" end def destroy(item_type_id) delete_request "/item-types/#{item_type_id}" end end end end end
Version data entries
40 entries across 40 versions & 1 rubygems