WEBVTT

00:03.790 --> 00:05.320
Hey, did everyone share?

00:05.320 --> 00:09.310
And in this video, we are going to work on the one route that is remaining for this project, which

00:09.310 --> 00:14.280
is slash admin slash order ID since this is a red one means we have to just delete this one.

00:14.290 --> 00:19.240
In fact, I would encourage you to pause this video right here, go further beyond me and just create

00:19.240 --> 00:19.600
this route.

00:19.610 --> 00:21.160
It should be really super simple.

00:21.460 --> 00:25.000
After that, we are going to be pushing the things on to the Git repository as well.

00:25.030 --> 00:28.750
This is not at all by any means a full fledged git tutorial.

00:28.750 --> 00:33.130
I do have a separate course on that, but still I would love to keep that onto a separate some remote

00:33.130 --> 00:34.470
repository or something.

00:34.480 --> 00:38.440
We won't be going into too much of detail, but still, at least we'll walk you through some of the

00:38.440 --> 00:39.220
basics of it.

00:39.220 --> 00:40.540
Not too much basics even.

00:40.570 --> 00:42.190
Let's go ahead and work on with that.

00:42.190 --> 00:44.140
So slash admin, slash order, slash ID.

00:44.140 --> 00:46.470
That means it will come to me in the params.

00:46.480 --> 00:47.890
Let's go ahead and work with that.

00:48.130 --> 00:53.590
I would simply go ahead and copy this one, shrink this one and expand this one.

00:53.590 --> 00:57.910
And we are going to go ahead and simply say admin, delete order.

00:59.370 --> 01:01.180
Or delete one order in this case.

01:01.200 --> 01:02.600
So this is all good.

01:02.610 --> 01:03.960
We need to find the order.

01:03.960 --> 01:06.660
We are going to go ahead and find the requested params dot id.

01:06.660 --> 01:07.440
So this is all good.

01:07.440 --> 01:10.290
We don't want to pass on anything inside the body.

01:10.290 --> 01:13.320
Delete means just all delete like old one.

01:13.560 --> 01:16.650
And we also don't need to update any of the stock.

01:16.650 --> 01:23.370
In the case of deletion, the order is not affecting anything in the in that case and instead of the

01:23.370 --> 01:27.180
order dot save, we have to just simply go ahead and say order dot remove.

01:27.180 --> 01:33.000
And in this case we are going to just pass on order success as true and that's pretty much it told you

01:33.000 --> 01:34.560
now things get repetitive.

01:34.590 --> 01:38.850
Even if you work in any other project or something, you're going to find that there is too much similarity

01:38.850 --> 01:40.140
of working with the things.

01:40.140 --> 01:41.610
So that's pretty much it.

01:41.700 --> 01:45.660
Let's go ahead and send this admin delete order into the root itself.

01:45.660 --> 01:52.140
So we're going to go ahead and this is an admin route, so slash order and did we actually put up this?

01:52.290 --> 01:57.090
This one was orders and another controller is admin update order.

01:57.090 --> 01:59.130
So we haven't actually worked on that part also.

01:59.130 --> 02:01.230
So let's go ahead and get a copy of this one.

02:01.380 --> 02:04.530
So let's go ahead and say we need a duplicate of this one.

02:05.190 --> 02:13.590
So this one was admin slash order and this one was a slash colon ID, so somebody gives me an ID, this

02:13.590 --> 02:20.910
one is a put request because we are updating this stuff and we need to bring in the root which is admin,

02:20.910 --> 02:27.900
get all orders and then we have admin update the order as well as admin delete the order.

02:29.190 --> 02:31.860
Let's use a comma for housekeeping purposes.

02:32.100 --> 02:35.040
So first let's handle the update.

02:35.040 --> 02:36.210
So this is all good.

02:36.210 --> 02:37.740
Let's go ahead and make a copy.

02:37.830 --> 02:41.010
And similarly we have to make a copy of this one.

02:41.010 --> 02:42.870
Let's remove it like that.

02:43.020 --> 02:45.570
And this time this is a delete request.

02:46.470 --> 02:50.550
If delete request comes in, he should be logged in, he should be admin and this time he should be

02:50.550 --> 02:53.400
able to delete order.

02:53.400 --> 02:54.150
What was that.

02:54.150 --> 02:54.480
Admin.

02:54.480 --> 02:55.350
Delete order.

02:55.410 --> 02:57.420
Copy that and paste that.

02:58.020 --> 02:58.980
So there we go.

02:59.160 --> 03:03.660
In theory, at least all of our routes and everything are complete so we can go ahead and save this

03:03.660 --> 03:05.430
one and hopefully things are all okay.

03:05.460 --> 03:07.380
Yeah, it looks all okay, at least as of now.

03:07.620 --> 03:09.450
Let's go ahead and close all of these.

03:11.070 --> 03:12.600
So let's go ahead and close all of this.

03:12.600 --> 03:15.330
Let's actually push all of these things into the git repository.

03:15.330 --> 03:16.410
So how to do that?

03:16.680 --> 03:22.020
Although I highly recommend to take a dedicated git course in case you really want to understand what's

03:22.020 --> 03:23.250
happening behind the scene.

03:23.250 --> 03:27.480
You don't want to stick around with just firing three or four commands of Git without understanding

03:27.480 --> 03:28.680
what's actually happening.

03:28.680 --> 03:33.150
So let's go ahead and create a new, new file in the route of the project itself.

03:33.150 --> 03:39.330
We're going to call it as DOT, get ignore, make sure you call it exactly as git, ignore dot get ignored.

03:39.330 --> 03:44.370
It is really important in this file you can place all the folders that you don't want to push onto this

03:44.790 --> 03:48.360
any repository or servers or anywhere in the production.

03:48.360 --> 03:49.920
So first one is dot and V.

03:49.920 --> 03:52.590
We definitely want don't want this file to go up.

03:52.590 --> 03:59.370
The second one is the node modules, folder node underscore modules and the folder.

03:59.370 --> 04:00.750
So slash at the end of it.

04:00.750 --> 04:03.720
So these are two folders that I don't want to push anywhere.

04:03.930 --> 04:05.070
That's what I'm going to write.

04:05.070 --> 04:09.390
If you have any more files or folder or some testing, just go ahead and add them up here.

04:09.390 --> 04:11.730
It's automatically going to be not pushing them.

04:11.730 --> 04:15.880
The reason why we don't push the node module folder is because it is recreate able.

04:15.900 --> 04:20.970
As soon as you see this package or JSON, you can just run NPM install and it's going to automatically

04:20.970 --> 04:22.440
bring this node module folder.

04:22.440 --> 04:24.810
That's pretty much easy, as simple as it can be.

04:24.810 --> 04:29.340
Let's go ahead and kill the process of this one and let's go ahead and initialize a git repository here.

04:29.340 --> 04:31.410
So we're going to go ahead and say, get in it.

04:31.410 --> 04:34.440
This is going to initialize a git a git folder here.

04:34.440 --> 04:39.240
Now this folder is a little bit tricky that you are not going to see that, but trust me, it is there.

04:39.240 --> 04:42.630
I can show you that by showing you the hidden files up here.

04:42.630 --> 04:44.580
Let me expand this a little bit up here.

04:44.670 --> 04:49.980
So if I go ahead and say, ls dash l a, it's going to give me the files.

04:49.980 --> 04:54.300
So if I can scroll a little bit notice here there is a dot git folder here.

04:54.300 --> 04:56.850
Now this folder is not visible in windows just like that.

04:56.850 --> 05:00.150
You have to unlock the show me hidden folders or something like that.

05:00.150 --> 05:04.770
And Linux and Mac, I can just go ahead and run this command which is ls dash le which shows me the

05:04.770 --> 05:05.610
hidden folder.

05:05.820 --> 05:07.770
Now git is initialized here.

05:07.770 --> 05:09.600
Now we need to add all the folders up here.

05:09.600 --> 05:11.520
So we're going to go ahead and say get add.

05:11.520 --> 05:17.190
Now you can name your file one by one like JS, but since there is a lot that I have to initialize in

05:17.190 --> 05:21.210
the repository, I can just say dot, that means, hey, whatever is there in the current folder where

05:21.210 --> 05:23.700
I am right now, just add everything there.

05:23.850 --> 05:29.190
So we're going to go ahead and add this all and this is this is technically added.

05:29.190 --> 05:33.870
As for monitoring, this has not been pushed into a git a project itself.

05:33.870 --> 05:35.610
So we're going to go ahead and do that now.

05:35.610 --> 05:40.920
So we're going to go ahead and say get commit, make a comment and make sure you provide a dash and

05:40.920 --> 05:41.580
then a message.

05:41.580 --> 05:45.600
If you are not going to provide that, it's going to open up your default editor, which can be notepad

05:45.600 --> 05:46.500
or something else.

05:46.500 --> 05:58.620
So we're going to go ahead and say first push for D store D Store project.

05:59.020 --> 06:02.470
And of course, after this, there are going to be many more comments up here because I'm pretty sure

06:02.470 --> 06:06.400
there are lots of errors in this project, and eventually that's how the project actually evolves.

06:06.610 --> 06:11.370
So this is all being done and now things are actually being tracked and everything is all okay.

06:11.380 --> 06:12.520
So this is all good.

06:12.520 --> 06:17.470
In case you are having a GitHub account or GitLab account or whatever there is, you may find a remote

06:17.470 --> 06:23.860
repository there and instructions that how we can push this existing repository onto a remote repository

06:23.860 --> 06:28.300
somewhere like GitLab or GitHub, you can just do follow those commands as well, but that's pretty

06:28.300 --> 06:29.800
much it from our side.

06:29.830 --> 06:32.050
Let's go ahead and catch up in the next video.
