Commit 548281a6 authored by Khalid Ali's avatar Khalid Ali
Browse files

DELETE request for listing added

parent 1f264c2e
......@@ -39,4 +39,8 @@ public class ListingService {
public void updateListing(ListingEntity listingEntity) {
listingRepository.save(listingEntity);
}
public void deleteListing(Long id) {
listingRepository.deleteById(id);
}
}
......@@ -61,6 +61,11 @@ public class BookshareApiController {
listingService.updateListing(listingEntity);
}
@DeleteMapping(value = "/listing/{id}")
void deleteListing(@PathVariable Long id) {
listingService.deleteListing(id);
}
private ListingDto convertToDto(ListingEntity listingEntity) {
ListingDto listingDto = modelMapper.map(listingEntity, ListingDto.class);
listingDto.setCreateDate(listingEntity.getCreateDate());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment