Skip to content

Commit d5eadc9

Browse files
committed
Added ability to delete comment.
1 parent f4259fe commit d5eadc9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/com/aaroncoplan/todoist/Todoist.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,4 +368,16 @@ public void updateComment(long id, String content) {
368368
e.printStackTrace();
369369
}
370370
}
371+
372+
public void deleteComment(long id) {
373+
try {
374+
HttpResponse<String> response = Unirest.delete(URL_BASE + "/comments/" + id)
375+
.asString();
376+
if(response.getStatus() != HTTP_OK_NO_CONTENT) {
377+
throw new Exception("HTTP STATUS " + response.getStatus());
378+
}
379+
} catch (Exception e) {
380+
e.printStackTrace();
381+
}
382+
}
371383
}

0 commit comments

Comments
 (0)