add endpoint to delete trip with given id
This commit is contained in:
@@ -12,7 +12,6 @@ import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -67,4 +66,13 @@ public class TripController {
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@Operation(summary = "Delete a trip for the authenticated user.")
|
||||
@DeleteMapping("/deleteTrip/{tripId}")
|
||||
public ResponseEntity<Void> deleteTrip(@PathVariable Long tripId) {
|
||||
User user = currentUser.get();
|
||||
|
||||
tripService.deleteTrip(user, tripId);
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user