I have a Project Management app buildt with JavaScript on the front end and PHP/MySQL on the back end.
I want to have an array holding all the Task ID's that a user is subscribed to notifications on.
When I show a Task record I want to set the status of the subscribe button based on if the user is subscribed already or not.
I also want the ability to add and remove task entrioes from the users array of subscriptions.
I am thinking something like this below would be a good start...
var userTaskSubscriptions = [{
task_id: 1,
subscribed: 'yes'
},
{
task_id: 2,
subscribed: 'yes'
},
{
task_id: 3,
subscribed: 'yes'
}]
In this example above I need some JavaScript code to allow me to check if user has an entry above for Task ID #2 and min this case they would have one.
I also need code to add and remove entries from it.
Any help here?
Map,Array.prototype.find, etc, available?