Skip to content

Commit

Permalink
Remove create_tag API and add remove_tag API
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Jun 9, 2015
1 parent 8b50c1d commit 420d9f8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 36 deletions.
13 changes: 4 additions & 9 deletions teambition/api/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,15 @@ def get_tags(self, id):
"""
return self._get('api/events/{0}/tags'.format(id))

def create_tag(self, id, name):
def remove_tag(self, id, tag_id):
"""
新建标签
移除标签
:param id: 日程 ID
:param name: 标签名称
:param tag_id: 标签 ID
:return: 返回的 JSON 数据包
"""
return self._post(
'api/events/{0}/tags'.format(id),
data={
'name': name
}
)
return self._delete('api/events/{0}/tags/{1}'.format(id, tag_id))

def add_tag(self, id, tag_id):
"""
Expand Down
13 changes: 4 additions & 9 deletions teambition/api/posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,20 +181,15 @@ def get_tags(self, id):
"""
return self._get('api/posts/{0}/tags'.format(id))

def create_tag(self, id, name):
def remove_tag(self, id, tag_id):
"""
新建标签
移除标签
:param id: 分享 ID
:param name: 标签名称
:param tag_id: 标签 ID
:return: 返回的 JSON 数据包
"""
return self._post(
'api/posts/{0}/tags'.format(id),
data={
'name': name
}
)
return self._delete('api/posts/{0}/tags/{1}'.format(id, tag_id))

def add_tag(self, id, tag_id):
"""
Expand Down
13 changes: 4 additions & 9 deletions teambition/api/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,20 +332,15 @@ def get_tags(self, id):
"""
return self._get('api/tasks/{0}/tags'.format(id))

def create_tag(self, id, name):
def remove_tag(self, id, tag_id):
"""
新建标签
移除标签
:param id: 任务 ID
:param name: 标签名称
:param tag_id: 标签 ID
:return: 返回的 JSON 数据包
"""
return self._post(
'api/tasks/{0}/tags'.format(id),
data={
'name': name
}
)
return self._delete('api/tasks/{0}/tags/{1}'.format(id, tag_id))

def add_tag(self, id, tag_id):
"""
Expand Down
13 changes: 4 additions & 9 deletions teambition/api/works.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,20 +161,15 @@ def get_tags(self, id):
"""
return self._get('api/works/{0}/tags'.format(id))

def create_tag(self, id, name):
def remove_tag(self, id, tag_id):
"""
新建标签
移除标签
:param id: 文件 ID
:param name: 标签名称
:param name: 标签 ID
:return: 返回的 JSON 数据包
"""
return self._post(
'api/works/{0}/tags'.format(id),
data={
'name': name
}
)
return self._delete('api/works/{0}/tags/{1}'.format(id, tag_id))

def add_tag(self, id, tag_id):
"""
Expand Down

0 comments on commit 420d9f8

Please sign in to comment.