Bugfixes, Dating angefangen
Some checks failed
Host-Based Deploy (Java 21 Fix) / build-and-run (push) Has been cancelled
Some checks failed
Host-Based Deploy (Java 21 Fix) / build-and-run (push) Has been cancelled
This commit is contained in:
@@ -113,7 +113,7 @@ public class GruppeController {
|
||||
// ── GET /gruppe/{id} ──
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseEntity<GruppeDto> getGruppe(@PathVariable UUID id, Principal principal) {
|
||||
public ResponseEntity<GruppeDto> getGruppe(@PathVariable("id") UUID id, Principal principal) {
|
||||
UUID myId = resolveMyId(principal);
|
||||
if (myId == null) return ResponseEntity.status(401).build();
|
||||
|
||||
@@ -155,7 +155,7 @@ public class GruppeController {
|
||||
// ── PUT /gruppe/{id} ──
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public ResponseEntity<GruppeDto> updateGruppe(@PathVariable UUID id,
|
||||
public ResponseEntity<GruppeDto> updateGruppe(@PathVariable("id") UUID id,
|
||||
@RequestBody UpdateGruppeRequest req,
|
||||
Principal principal) {
|
||||
UUID myId = resolveMyId(principal);
|
||||
@@ -180,7 +180,7 @@ public class GruppeController {
|
||||
// ── DELETE /gruppe/{id} ──
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Void> deleteGruppe(@PathVariable UUID id, Principal principal) {
|
||||
public ResponseEntity<Void> deleteGruppe(@PathVariable("id") UUID id, Principal principal) {
|
||||
UUID myId = resolveMyId(principal);
|
||||
if (myId == null) return ResponseEntity.status(401).build();
|
||||
|
||||
@@ -215,7 +215,7 @@ public class GruppeController {
|
||||
// ── POST /gruppe/{id}/join ──
|
||||
|
||||
@PostMapping("/{id}/join")
|
||||
public ResponseEntity<Void> join(@PathVariable UUID id,
|
||||
public ResponseEntity<Void> join(@PathVariable("id") UUID id,
|
||||
@RequestBody(required = false) JoinRequest req,
|
||||
Principal principal) {
|
||||
UUID myId = resolveMyId(principal);
|
||||
@@ -260,7 +260,7 @@ public class GruppeController {
|
||||
// ── DELETE /gruppe/{id}/leave ──
|
||||
|
||||
@DeleteMapping("/{id}/leave")
|
||||
public ResponseEntity<Void> leave(@PathVariable UUID id, Principal principal) {
|
||||
public ResponseEntity<Void> leave(@PathVariable("id") UUID id, Principal principal) {
|
||||
UUID myId = resolveMyId(principal);
|
||||
if (myId == null) return ResponseEntity.status(401).build();
|
||||
|
||||
@@ -272,7 +272,7 @@ public class GruppeController {
|
||||
// ── GET /gruppe/{id}/members ──
|
||||
|
||||
@GetMapping("/{id}/members")
|
||||
public ResponseEntity<List<Map<String, Object>>> getMembers(@PathVariable UUID id, Principal principal) {
|
||||
public ResponseEntity<List<Map<String, Object>>> getMembers(@PathVariable("id") UUID id, Principal principal) {
|
||||
UUID myId = resolveMyId(principal);
|
||||
if (myId == null) return ResponseEntity.status(401).build();
|
||||
if (mitgliedRepository.findFirstByGruppeIdAndUserId(id, myId).isEmpty())
|
||||
@@ -298,8 +298,8 @@ public class GruppeController {
|
||||
// ── DELETE /gruppe/{id}/members/{userId} ──
|
||||
|
||||
@DeleteMapping("/{id}/members/{userId}")
|
||||
public ResponseEntity<Void> removeMember(@PathVariable UUID id,
|
||||
@PathVariable UUID userId,
|
||||
public ResponseEntity<Void> removeMember(@PathVariable("id") UUID id,
|
||||
@PathVariable("userId") UUID userId,
|
||||
Principal principal) {
|
||||
UUID myId = resolveMyId(principal);
|
||||
if (myId == null) return ResponseEntity.status(401).build();
|
||||
@@ -313,8 +313,8 @@ public class GruppeController {
|
||||
// ── POST /gruppe/{id}/members/{userId}/promote ──
|
||||
|
||||
@PostMapping("/{id}/members/{userId}/promote")
|
||||
public ResponseEntity<Void> promote(@PathVariable UUID id,
|
||||
@PathVariable UUID userId,
|
||||
public ResponseEntity<Void> promote(@PathVariable("id") UUID id,
|
||||
@PathVariable("userId") UUID userId,
|
||||
Principal principal) {
|
||||
UUID myId = resolveMyId(principal);
|
||||
if (myId == null) return ResponseEntity.status(401).build();
|
||||
@@ -331,7 +331,7 @@ public class GruppeController {
|
||||
// ── GET /gruppe/{id}/requests ──
|
||||
|
||||
@GetMapping("/{id}/requests")
|
||||
public ResponseEntity<List<BeitrittsanfrageDto>> getRequests(@PathVariable UUID id, Principal principal) {
|
||||
public ResponseEntity<List<BeitrittsanfrageDto>> getRequests(@PathVariable("id") UUID id, Principal principal) {
|
||||
UUID myId = resolveMyId(principal);
|
||||
if (myId == null) return ResponseEntity.status(401).build();
|
||||
if (!isAdmin(id, myId)) return ResponseEntity.status(403).build();
|
||||
@@ -353,8 +353,8 @@ public class GruppeController {
|
||||
// ── POST /gruppe/{id}/requests/{reqId}/approve ──
|
||||
|
||||
@PostMapping("/{id}/requests/{reqId}/approve")
|
||||
public ResponseEntity<Void> approveRequest(@PathVariable UUID id,
|
||||
@PathVariable UUID reqId,
|
||||
public ResponseEntity<Void> approveRequest(@PathVariable("id") UUID id,
|
||||
@PathVariable("reqId") UUID reqId,
|
||||
Principal principal) {
|
||||
UUID myId = resolveMyId(principal);
|
||||
if (myId == null) return ResponseEntity.status(401).build();
|
||||
@@ -383,8 +383,8 @@ public class GruppeController {
|
||||
// ── DELETE /gruppe/{id}/requests/{reqId} ──
|
||||
|
||||
@DeleteMapping("/{id}/requests/{reqId}")
|
||||
public ResponseEntity<Void> rejectRequest(@PathVariable UUID id,
|
||||
@PathVariable UUID reqId,
|
||||
public ResponseEntity<Void> rejectRequest(@PathVariable("id") UUID id,
|
||||
@PathVariable("reqId") UUID reqId,
|
||||
Principal principal) {
|
||||
UUID myId = resolveMyId(principal);
|
||||
if (myId == null) return ResponseEntity.status(401).build();
|
||||
@@ -456,7 +456,7 @@ public class GruppeController {
|
||||
// ── DELETE /gruppe/{id}/requests/mine (withdraw own request) ──
|
||||
|
||||
@DeleteMapping("/{id}/requests/mine")
|
||||
public ResponseEntity<Void> withdrawRequest(@PathVariable UUID id, Principal principal) {
|
||||
public ResponseEntity<Void> withdrawRequest(@PathVariable("id") UUID id, Principal principal) {
|
||||
UUID myId = resolveMyId(principal);
|
||||
if (myId == null) return ResponseEntity.status(401).build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user