Skip to content

Commit

Permalink
timeline control formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
breed committed May 14, 2024
1 parent 3c53ac5 commit cd9bb25
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ public ResponseEntity<List<UserList>> getApiV1Lists(Principal user) {
}

@GetMapping("/api/v1/markers")
public Mono<ResponseEntity<Map<String, Marker>>> getApiV1Markers(Principal user, @RequestParam(name =
"timeline" + "[]") List<String> timeline) {
public Mono<ResponseEntity<Map<String, Marker>>> getApiV1Markers(Principal user, @RequestParam(name = "timeline[]")
List<String> timeline) {
if (user == null) return Mono.just(ResponseEntity.status(HttpStatus.UNAUTHORIZED).build());
return timelineService.getMarkersForUser(user.getName(), timeline).map(ResponseEntity::ok);
}

@PostMapping("/api/v1/markers")
public Mono<ResponseEntity<Map<String, Marker>>> postApiV1Markers(Principal user, @RequestParam(name = "home" +
"[last_read_id]", required = false) String homeLast, @RequestParam(name = "notifications[last_read_id]",
required = false) String notificationsLast) {
"[last_read_id]", required = false) String homeLast, @RequestParam(name = "notifications" +
"[last_read_id]", required = false) String notificationsLast) {
if (user == null) return Mono.just(ResponseEntity.status(HttpStatus.UNAUTHORIZED).build());
return timelineService.setMarkerForUser(user.getName(), homeLast, notificationsLast).map(ResponseEntity::ok);
}
Expand All @@ -54,7 +54,8 @@ Mono<ResponseEntity<List<Status>>> getApiV1TimelinesHome(Principal user,
@RequestParam(required = false) String max_id,
@RequestParam(required = false) String since_id,
@RequestParam(required = false) String min_id,
@RequestParam(required = false, defaultValue = "20") int limit) {
@RequestParam(required = false, defaultValue = "20")
int limit) {
return statusService.getTimeline(user, max_id, since_id, min_id, limit, false).map(ResponseEntity::ok);
}
}

0 comments on commit cd9bb25

Please sign in to comment.