Skip to content

Commit

Permalink
Removed test try/catch and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianfish committed Jan 22, 2025
1 parent 06de7cf commit 21a6c22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,10 @@ private EntityModel entityModelForTopicBean(TopicTransferBean topicBean) {
@PostMapping(value = "/sites/{siteId}/topics/{topicId}/posts", produces = MediaType.APPLICATION_JSON_VALUE)
public EntityModel<PostTransferBean> createPost(@PathVariable String siteId, @PathVariable String topicId, @RequestBody PostTransferBean postBean) throws ConversationsPermissionsException {

try {
checkSakaiSession();
postBean.siteId = siteId;
postBean.topic = topicId;
return entityModelForPostBean(conversationsService.savePost(postBean, true));
} catch (Exception e) {
e.printStackTrace();
}
return null;
checkSakaiSession();
postBean.siteId = siteId;
postBean.topic = topicId;
return entityModelForPostBean(conversationsService.savePost(postBean, true));
}

@GetMapping(value = "/sites/{siteId}/topics/{topicId}/posts", produces = MediaType.APPLICATION_JSON_VALUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class SakaiTopic extends reactionsAndUpvotingMixin(SakaiElement) {
this.topic.posts = posts;

// We've clicked on a topic and it has no posts. Ergo, it has been "viewed".
//if (!this.topic?.posts?.length) this.topic.viewed = true;
if (!this.topic?.posts?.length) this.topic.viewed = true;

update();
this.dispatchEvent(new CustomEvent("topic-updated", { detail: { topic: this.topic, dontUpdateCurrent: true }, bubbles: true }));
Expand Down

0 comments on commit 21a6c22

Please sign in to comment.