Skip to content

chore: (WIP) add JBey @DeleteMapping request for lesson_26 #604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

jbey251
Copy link
Contributor

@jbey251 jbey251 commented May 5, 2025

No description provided.

@@ -1,6 +1,7 @@
package com.codedifferently.lesson26.web;

import java.util.List;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty line, you should only be modifying the MediaItemsController

@@ -31,4 +35,18 @@ public ResponseEntity<GetMediaItemsResponse> getItems() {
var response = GetMediaItemsResponse.builder().items(responseItems).build();
return ResponseEntity.ok(response);
}

@DeleteMapping("/items/{id}")
public ResponseEntity<Void> deleteItem(@PathVariable String id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method works well. I recommend changing the @PathVariable type from String to UUID to leverage Spring’s built-in validation and ensure invalid UUIDs are rejected automatically with a 400 Bad Request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants