ID three. Oh! ID 15. Okay, ID 15, right. The user is three, ID 15. Yeah, so we get our suite back. So, unlike Twitter, we want our suites to, like, we want our user to be able to update the suite, right? So we're gonna do two more endpoints, and we'll call it a wrap. Is that good?
Okay. So let me see. Do we have any questions so far? Are we also working on, as I'm adding them, do we also work on them? Any questions? Let's see what's happening in the chats. Okay, for some reason my noise not working. Okay, so are there any questions? So that's...
Okay, so let's add updates suites. So update suites will clear that request, call update suites. So it's gonna be a patch request. Suites, so a patch request with the suite ID. So before, let me just create more suites, so we'll have a whole set of suites to involve. Okay, and another suite. Another suite. Okay, all right. So you can create as many users, if you have postman on, you can create as many users as you want. Okay, and yeah, so let's do that. So we're gonna do patch and we're gonna do delete, then we'll call it a wrap, I will share the collection with you and also the GitHub repo where you could get it from. So I do know it's getting pretty late over there. Alright, so let's quickly do update. So to do the update, we're gonna come back here, sales generate action, suite updates, suites. Okay, then we're gonna go to the routes, we'll come here and say, okay, we need a patch route. So any patch will be put in the routes. So these, suite, we just say which update suites, okay. And from the suites well here in this stage, so we have a text, definitely, so we need a text, for the suite ID, which is a suite we're passing there, should be a number, it's not like a number, should be a number here. and it should be, required through, and it should be It's the integer. And type string, the string which is, the text you want to leave the sweets with, it should be required as we are not going to give an empty text, required through, and we're gonna have some couple of exits here, first of all we gonna have like, sweets updated, then we gonna have, sweets not found, sorry, case, so it's gonna be status code, 4.0.4, description, sweets not found, and gonna have, not authorized here as well, so what this will be, so if a user is trying to update it, which he does not, he didn't create, when he responds with a false, stop of right, he can't do that, that's criminal, do not update sweets within creates, so when there's a, as you cannot updates sweets, okay? So here, just leave it as ID, I just like being consistent with this one, so I can remove this, so I can leave it as sweets, if you want, so this will also work, so we are sweet. Text, then would have an exit here, and say, sweet to update, but okay, sweet to update, say I'll wait, sweet. updates, okay, first of all let's find the sweet, I'm just trying to sweet sweet update, equals to await sweet.find1, so if it exists, let's find it first, so will leave, now sweet on date, then we return exit.sweet not found, so access before this message, sweet not found, and else if, so if sweet2update.author is not equal to not equal to the date, and exit.break, for session user ID. Then this user will start to use create as a sweep, at the script. So to return exit.notauthorized, success false, message, message, notauthorized, or this action, sort of speak. Then lastly, that means everything is all good. If none of those branches was calling that means everything is all good, they would just return. So, it's, so just updates the switch as before we've done it. So we do false, updated, switch, await, switch dots update one. So we have UpdateOne method. So find it by ID, dot sets or comma seven. It's a passing dot text. Okay. So that's good and then we will have, gonna return, exit dot success, and we'll return success to, then return updateん switch. Okay. Like so, as I said the same here. So this work. So go through switch is declared. We will never use it. Okay. We're mapping to this. Yeah, and that should work. So if we start our server now and we call to all these switches. So we would have a text updated from Ghostman, like so. And yeah, this should complain because we're not loading. Yeah, if we're logging now, and if we check all that, okay, so let's, this is 16, more with ID of 16. Let's update that. So 16, so we'll say update from Ghostman. And yeah, update their flow, oh, type, you can still, so because we're not tweeted, we can update and we will be using fix that type right there. So that's for the update. Lastly, before we wrap this up, since we're way beyond time, we could, the routes to delete sweets, okay. Let's delete that sweet. So we add delete sweets. So it's just gonna be a delete request. So it still supports the delete request and it can be sweets and just the idea of the sweets to delete so they can be keeping everything persistent for the routes. We just paste it. Okay, we could sweets. Delete. Sweets. Sweets.