‫Finally, let's now handle the lead requests,
‫as well.
‫And just like in the previous lecture,
‫I will not actually implement the deleting
‫of a resource in our route handle.
‫Okay?
‫So, that is not necessary because, again,
‫we are only dealing with files,
‫which is not a real world scenario, okay?
‫So I simply went ahead and copied the handler
‫that we created in the last lecture.
‫And so let's just do some quick changes here
‫to handle the delete request, as well.
‫So, the first thing is of course,
‫this method here which is now not patch, but delete.
‫Okay?
‫Then we still need to pass in an ID
‫for the tour that we actually want to delete.
‫And then let's also change our response.
‫So when we have a delete request,
‫the response is usually a 204.
‫And 204 means no content.
‫And so that's because, as a result,
‫we usually don't sent any data back.
‫Instead, we just sent null, okay?
‫So the status is still a success, but the data is null,
‫simply to show that the resource that we deleted
‫now no longer exists.
‫So that is what null means.
‫Okay?
‫So pretty similar to patch,
‫the difference here, in this case here,
‫is that we change the delete method,
‫we change the status code to no content, which is 204,
‫and the data that we send back is null.
‫Okay, and so even in the real world,
‫that is exactly the response that we're gonna send back.
‫Okay, so now all we have to do go, ahead and test it out.
‫And using of course, delete.
‫Let me also save it here as delete tour.
‫And so let's pretend that we want to delete
‫tour number seven.
‫Again, that's not gonna do anything.
‫And so here we have our tool for no content.
‫And actually, Postman then indeed shows us here
‫no content at all.
‫So it doesn't even show us the adjacent that we sent back.
‫It simply gives us 204 no content.
‫Okay?
‫So let's just save it here.
‫We have it here on the left side now, as well.
‫And you'll see that our collection here is steadily growing,
‫so that's really cool.
‫Now, in the next video
‫we will actually make our code look a bit nicer.
‫So organize it and follow some best practices
‫to make our code a bit less messy.