Skip to content

Commit 42b48fb

Browse files
committed
forgot endpoint to get chan
1 parent a173d30 commit 42b48fb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

artcoded/src/main/java/tech/artcoded/websitev2/pages/report/ReportController.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public ResponseEntity<Post> getPostById(@RequestParam("id") String id) {
159159
}
160160

161161
@PostMapping("/channel/subscribe")
162-
public ResponseEntity<Channel> getPostById(@RequestParam("id") String id, Principal principal) {
162+
public ResponseEntity<Channel> subscribe(@RequestParam("id") String id, Principal principal) {
163163
var user = User.fromPrincipal(principal);
164164
return this.channelService.getChannelByCorrelationId(id)
165165
.map(ch -> ch.toBuilder()
@@ -170,6 +170,12 @@ public ResponseEntity<Channel> getPostById(@RequestParam("id") String id, Princi
170170
.map(ResponseEntity::ok).orElseGet(ResponseEntity.noContent()::build);
171171
}
172172

173+
@PostMapping("/channel/get")
174+
public ResponseEntity<Channel> getChannelByCorrelationId(@RequestParam("id") String id, Principal principal) {
175+
return this.channelService.getChannelByCorrelationId(id)
176+
.map(ResponseEntity::ok).orElseGet(ResponseEntity.noContent()::build);
177+
}
178+
173179
@PostMapping("/channel/post")
174180
public void postMessage(@RequestParam("id") String id,
175181
@RequestParam("message") String message,

0 commit comments

Comments
 (0)