Skip to content

Commit

Permalink
Guide: API: Update zones documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nnande committed Mar 20, 2017
1 parent 37ef12b commit 3064724
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
13 changes: 7 additions & 6 deletions guides/content/api/zones.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ per_page
<%= json(:zone) do |h|
{ zones: [h],
count: 25,
pages: 5,
current_page: 1 }
current_page: 1,
pages: 5 }
end %>
## Search
Expand All @@ -50,8 +50,8 @@ The search results are paginated.
<%= json(:zone) do |h|
{ zones: [h],
count: 25,
pages: 5,
current_page: 1 }
current_page: 1,
pages: 5 }
end %>
### Sorting results
Expand Down Expand Up @@ -99,7 +99,9 @@ a zone member which is a `Spree::Country` record with the `id` attribute of 1, s
### Response
<%= headers 201 %>
<%= json(:zone) %>
<%= json(:zone) do |h|
h.merge("name" => "North Pole")
end %>
## Update
Expand All @@ -113,7 +115,6 @@ PUT /api/v1/zones/1```
To update zone and zone member information, use parameters like this:
<%= json \
id: 1,
zone: {
name: "North Pole",
zone_members: [
Expand Down
18 changes: 9 additions & 9 deletions guides/lib/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -485,11 +485,19 @@ def commit(sha)
"name" => "Defaukt category"
}

ZONE_MEMBER ||=
{
"id"=>1,
"zoneable_type"=>"Spree::Country",
"zoneable_id"=>1
}

ZONE ||=
{
"id"=>1,
"name"=>"America",
"description"=>"The US"
"description"=>"The US",
"zone_members"=>[ZONE_MEMBER]
}

SHIPPING_METHOD ||=
Expand Down Expand Up @@ -947,14 +955,6 @@ def commit(sha)
"root" => TAXON_WITHOUT_CHILDREN
}

ZONE_MEMBER ||=
{
"id"=>1,
"name"=>"United States",
"zoneable_type"=>"Spree::Country",
"zoneable_id"=>1,
}

RETURN_AUTHORIZATION ||=
{
"id"=>1,
Expand Down

0 comments on commit 3064724

Please sign in to comment.