lib/dato/account/repo/site.rb in dato-0.1.5 vs lib/dato/account/repo/site.rb in dato-0.1.6

- old
+ new

@@ -1,33 +1,33 @@ +# frozen_string_literal: true require 'dato/account/repo/base' module Dato module Account module Repo class Site < Base - def find(site_id) get_request "/sites/#{site_id}" end - def all() - get_request "/sites" + def all + get_request '/sites' end def create(resource_attributes) body = JsonApiSerializer.new( type: :site, - attributes: %i(domain name notes template), + attributes: %i(domain name notes template) ).serialize(resource_attributes) - post_request "/sites", body + post_request '/sites', body end def update(site_id, resource_attributes) body = JsonApiSerializer.new( type: :site, - attributes: %i(domain name notes), + attributes: %i(domain name notes) ).serialize(resource_attributes, site_id) put_request "/sites/#{site_id}", body end @@ -36,15 +36,14 @@ end def duplicate(site_id, resource_attributes) body = JsonApiSerializer.new( type: :site, - attributes: %i(name), + attributes: %i(name) ).serialize(resource_attributes) post_request "/sites/#{site_id}/duplicate", body end - end end end end