Delete suggestion

the suggestion array has stored the array of all the suggestions, but we
want to find the suggestion that matches the suggestion.id passed from the
template--that is the one that must be deleted

On 30 September 2014 17:45, Oliver Azevedo Barnes <notifications@github.com>
wrote:

> In app/routes/initiative.js:
>
> > @@ -16,9 +16,24 @@ var InitiativeRoute = Ember.Route.extend({
> >        var initiative = this.get('controller.model');
> >        initiative.set('isSupported', false);
> >        this.transitionTo('initiative');
> > +    },
> > +
> > +    deleteSuggestion: function (suggestion_id) {
> > +      var suggestion_array = this.currentModel._data.suggestions;
> > +      var initiative = this.currentModel;
> > +
> > +      for (var i = 0; i < suggestion_array.length; i++) {
> > +        if (suggestion_array[i].id === suggestion_id) {
>
> Why this check for the suggestion id being currentModel.suggestions?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/oliverbarnes/participate-frontend/pull/73/files#r18221441>
> .
>