Noodleface
A Mod Real Quick
My opinion is that front end design is for fags.
- 1
My opinion is that front end design is for fags.
You can have your HTTP DELETE return a response with the updated list. Obviously, this is a bad idea if you have a massive list. But for small lists it's fine.Angular or front end design bros. Let's say you have a simple to-do list app. You delete an item from a list and want the app to reflect that.. After a http delete call would you make another API call to get the updated list or store a copy of the notes in an array locally in a service class and just splice it? What would be the most often used route to go about this?
Seems like it's more of a trade-off on performance versus data integrity.
Right. Mirror the list on the front end, if delete returns a 200 or 204 then splice that deleted one our of your array in the front end side. I mean obviously changing the in memory values would be dependent on checking for successful http return codes. No?You can have your HTTP DELETE return a response with the updated list. Obviously, this is a bad idea if you have a massive list. But for small lists it's fine.
But I would NOT manipulate an in-memory list of items and "assume" that the back-end call completed successfully. What if the db crapped out for some reason? etc.
Personally, I think you should either return a refreshed list with the 200 response from your DELETE -or- perform a GET request to re-fetch the list. I really don't like splicing arrays. Granted, this will work fine with a simple 'TODO' app. However, think in real-world scenarios where you might have a multi-user application. You don't know if the in-memory list has become stale. For example, what if other operations from other users (adds, updates, deletes) have been fired off in the meantime?Right. Mirror the list on the front end, if delete returns a 200 or 204 then splice that deleted one our of your array in the front end side. I mean obviously changing the in memory values would be dependent on checking for successful http return codes. No?
Ahh ok I get you. Maybe just make a deleteAndGetList endpoint? I still want to expose just a delete endpoint. I think you just gave me the solution.Personally, I think you should either return a refreshed list with the 200 response from your DELETE -or- perform a GET request to re-fetch the list. I really don't like splicing arrays. Granted, this will work fine with a simple 'TODO' app. However, think in real-world scenarios where you might have a multi-user application. You don't know if the in-memory list has become stale. For example, what if other operations from other users (adds, updates, deletes) have been fired off in the meantime?
Well, if you follow the "rules" of REST API, all you should have is GET, POST, PUT, DELETE endpoints. Don't create endpoints that act like function calls.Ahh ok I get you. Maybe just make a deleteAndGetList endpoint? I still want to expose just a delete endpoint. I think you just gave me the solution.
Is this for Outlook (desktop app, not web)?What technology would be the easiest/fastest way to automate opening and clicking a link in an email?
I get emails for golf event signups one month before each event at 6am. Problem is there are a limited number of slots available and the old timers are all awake at 6am and get in before I bother to drag my ass out of bed. Would like to automate this signup process so I can sleep in.
Keep in mind I'm a .NET guy. That doesn't mean I have to do this using something in the .NET stack but it's something I'm more familiar with and already have development tools and the IDE for it so might make that part easier.
It's been about 16 years since I did any web development.
Ok then I'll just call a delete, if successful return http code then a get call. Thanks shaky.Well, if you follow the "rules" of REST API, all you should have is GET, POST, PUT, DELETE endpoints. Don't create endpoints that act like function calls.
What technology would be the easiest/fastest way to automate opening and clicking a link in an email?
I get emails for golf event signups one month before each event at 6am. Problem is there are a limited number of slots available and the old timers are all awake at 6am and get in before I bother to drag my ass out of bed. Would like to automate this signup process so I can sleep in.
Keep in mind I'm a .NET guy. That doesn't mean I have to do this using something in the .NET stack but it's something I'm more familiar with and already have development tools and the IDE for it so might make that part easier.
It's been about 16 years since I did any web development.
Personal gmail account accessed via chrome. I suppose I could set it up in a desktop email app if I wanted to/it made it that much easier.
If you're a .NET guy, then I think it should be fairly trivial to create a simple console app that makes a periodic call to a gmail API, looking whatever, and, lke TJT said, invoke the link. Unless you have to do more on the link's end?Well I was asking more what language(s) might make this easier/have built in functionality/libraries to facilitate this type of automation.
By the way, if you ever need to scrape HTML to find elements, click buttons, etc. a great library is Html Agility Pack.Yea just realized there is the gmail API and also a G Suite developer apps script for gmail. That works, thanks.
That's sick. Had no idea there was a Gmail api. I'll have to check this out laterYea just realized there is the gmail API and also a G Suite developer apps script for gmail. That works, thanks.
Yea just realized there is the gmail API and also a G Suite developer apps script for gmail. That works, thanks.