summaryrefslogtreecommitdiff
path: root/py-fake-service/app/pixelated_user_agent.py
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-08-12 14:34:27 -0300
committerDuda Dornelles <ddornell@thoughtworks.com>2014-08-12 14:54:29 -0300
commitcce7b837e4180167d426224ef625e12a8abc4994 (patch)
tree33716957d809f3345317ee91c9fb067c996eb761 /py-fake-service/app/pixelated_user_agent.py
parent103180329b3aad65fa816056c2ca2e9f51424507 (diff)
updating tags on py-fake-service
Diffstat (limited to 'py-fake-service/app/pixelated_user_agent.py')
-rw-r--r--py-fake-service/app/pixelated_user_agent.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/py-fake-service/app/pixelated_user_agent.py b/py-fake-service/app/pixelated_user_agent.py
index 48081bda..41188b01 100644
--- a/py-fake-service/app/pixelated_user_agent.py
+++ b/py-fake-service/app/pixelated_user_agent.py
@@ -53,8 +53,9 @@ def mails():
return respond_json(response)
-@app.route('/mail/<mail_id>', methods=['DELETE'])
+@app.route('/mail/<int:mail_id>', methods=['DELETE'])
def delete_mails(mail_id):
+ mail_service.delete_mail(mail_id)
return respond_json(None)
@@ -64,17 +65,19 @@ def tags():
return respond_json([tag.__dict__ for tag in tags])
-@app.route('/mail/<mail_id>')
+@app.route('/mail/<int:mail_id>')
def mail(mail_id):
return respond_json(mail_service.mail(mail_id).__dict__)
-@app.route('/mail/<mail_id>/tags')
+@app.route('/mail/<int:mail_id>/tags', methods=['POST'])
def mail_tags(mail_id):
- return respond_json([])
+ new_tags = request.json['newtags']
+ mail_service.update_tags_for(mail_id, new_tags)
+ return respond_json(request.json['newtags'])
-@app.route('/mail/<mail_id>/read', methods=['POST'])
+@app.route('/mail/<int:mail_id>/read', methods=['POST'])
def mark_mail_as_read(mail_id):
mail_service.mark_as_read(mail_id)
return ""
@@ -85,7 +88,7 @@ def contacts():
return respond_json({'contacts': mail_service.search_contacts(contacts_query)})
-@app.route('/draft_reply_for/<mail_id>')
+@app.route('/draft_reply_for/<int:mail_id>')
def draft_reply_for(mail_id):
return respond_json(None)