Last time, we already create a detailed page and now we are going to add a daily function to this back
and first at the department in the detail page.
We are going to at the is equal to delete button.
And then before the end of the party, we are going to add the squit and under the square we are going
to select the department and we add the on Iran.
And then the first thing is we are going to prevent the default essence, which is if we do not have
these, will refresh the page after we checked the buttons.
So now we are going to consult on the people in.
Now we go to the page and refresh and then we try to click on the delete button, you can see it already
pop up the message here.
So which made it work?
In order to get that IP, we also have to post her IP here.
So now we passed the items document IP, so we type item thought on the school I.D. and then we goosestep
percent and coastie and corrected and then we can get the IP by using Coniston.
IP is equal to the department, but they have that I.D. So now we can try to not allow the IP to see
whether it works or not.
We refresh the page and click on the delete.
Now you get the IP.
Yeah, many ways to get it, the other way to get your I.D. using the typical method, which is AECO
to eat or target thought Archibold, and since we're used to the idea.
So now we passed the data, I'd be here.
Now if we refresh the page and click on this piece, also can get the ID.
So now we turn on the original method and now we are going to create the end point items and you pass
the ID.
Now we back to the server and we make the delete request.
Now we are going to create a delete handle and this is actually very similar to this.
So we can copy and paste here and we are going to change this to delete.
And instead of five by IDEO, we are going to use the five by IP and delete and then we can delete this.
Now we back to the item detail page and after we have this end point, we can use Fach.
And then we passed the end point and then we specify the method is in it and then Tulpan and then we
use the cash to catch the error.
So now if we refresh the page and then we press delete and then we go back to the home page and now
you can see the full.
Already did.
And maybe we can also choose another items and then we press the date again and then we go to the home.
You see, you just have one item left.
Now we are going to the airport ask and then we are going to try to do the same things right before.
So after the date and then we go to redirect to the home page and then we try again.
You can see it.
Do not redirect to the home page.
And this is because this request is not from the form, for example, in this post that we crash.
For example, if we post the new items we are posting from the forms rather than like this time we are
going to use the HRC request to make the delete request.
So this make this redirects to the home page not work.
So in the next part we are going to fix these problems.