diff --git a/.github/workflows/reformat.yml b/.github/workflows/reformat.yml
new file mode 100644
index 00000000..416c484a
--- /dev/null
+++ b/.github/workflows/reformat.yml
@@ -0,0 +1,33 @@
+name: Re-format Code
+
+on:
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ format:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.pull_request.head.ref }}
+
+ - name: Install IntelliJ IDEA
+ run: |
+ wget -q -O idea.tar.gz https://download.jetbrains.com/idea/ideaIC-2024.1.1.tar.gz
+ tar -xzf idea.tar.gz
+
+ - name: Format code
+ run: |
+ ./*/bin/format.sh -m *.java -r .
+
+ - name: Commit changes
+ run: |
+ git config user.name 'github-actions[bot]'
+ git config user.email "github-actions[bot]@users.noreply.github.com
+ git commit -a -m "Auto-format code"
+ git push
+
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index 92162015..dccf94fa 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -11,16 +11,22 @@
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/server/src/main/java/edu/sjsu/moth/server/controller/TimelineController.java b/server/src/main/java/edu/sjsu/moth/server/controller/TimelineController.java
index 384764a0..36d075a8 100644
--- a/server/src/main/java/edu/sjsu/moth/server/controller/TimelineController.java
+++ b/server/src/main/java/edu/sjsu/moth/server/controller/TimelineController.java
@@ -35,16 +35,16 @@ public ResponseEntity> getApiV1Lists(Principal user) {
}
@GetMapping("/api/v1/markers")
- public Mono>> getApiV1Markers(Principal user, @RequestParam(name =
- "timeline" + "[]") List timeline) {
+ public Mono>> getApiV1Markers(Principal user, @RequestParam(name = "timeline[]")
+ List 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>> 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);
}
@@ -54,7 +54,8 @@ Mono>> 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);
}
}