Skip to content

Commit

Permalink
Update examples for contact roles
Browse files Browse the repository at this point in the history
The examples were missing the count_limit field.

JIRA: PDC-119
  • Loading branch information
lubomir committed Oct 26, 2015
1 parent 7ad08a7 commit 6204edc
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pdc/apps/contact/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def create(self, request, *args, **kwargs):
curl -H "Content-Type: application/json" -X POST -d '{"name": "test"}' $URL:contactrole-list$
# output
{"name": "test"}
{"name": "test", "count_limit": 1}
"""
return super(ContactRoleViewSet, self).create(request, *args, **kwargs)

Expand Down Expand Up @@ -378,9 +378,11 @@ def list(self, request, *args, **kwargs):
"results": [
{
"name": "qe_leader",
"count_limit": 1
},
{
"name": "qe_group",
"count_limit": 1
},
...
]
Expand All @@ -397,6 +399,7 @@ def list(self, request, *args, **kwargs):
"results": [
{
"name": "test",
"count_limit": 1
}
]
}
Expand All @@ -420,7 +423,7 @@ def retrieve(self, request, *args, **kwargs):
curl -H "Content-Type: application/json" $URL:contactrole-detail:QE_Leader$
# output
{"name": "QE_Leader"}
{"name": "QE_Leader", "count_limit": 1}
"""
return super(ContactRoleViewSet, self).retrieve(request, *args, **kwargs)

Expand All @@ -446,13 +449,13 @@ def update(self, request, *args, **kwargs):
curl -X PUT -d '{"name": "new_name"}' -H "Content-Type: application/json" $URL:contactrole-detail:QE_Ack$
# output
{"name": "new_name"}
{"name": "new_name", "count_limit": 1}
PATCH:
curl -X PATCH -d '{"name": "new_name"}' -H "Content-Type: application/json" $URL:contactrole-detail:QE_Ack$
curl -X PATCH -d '{"count_limit": "unlimited"}' -H "Content-Type: application/json" $URL:contactrole-detail:QE_Ack$
# output
{"name": "new_name"}
{"name": "new_name", "count_limit": "unlimited"}
"""
return super(ContactRoleViewSet, self).update(request, *args, **kwargs)

Expand Down

0 comments on commit 6204edc

Please sign in to comment.