Fix error dispatching
In other words, actually do it...
This commit is contained in:
@ -70,7 +70,7 @@ function fetchAll() {
|
||||
var e = new Error();
|
||||
e.fromJSON(data);
|
||||
if (e.isError()) {
|
||||
ErrorActions.serverError(e);
|
||||
dispatch(ErrorActions.serverError(e));
|
||||
} else {
|
||||
dispatch(attendeesFetched(data.attendees.map(function(json) {
|
||||
var a = new Attendee();
|
||||
@ -80,7 +80,7 @@ function fetchAll() {
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, status, error) {
|
||||
ErrorActions.ajaxError(e);
|
||||
dispatch(ErrorActions.ajaxError(e));
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -99,7 +99,7 @@ function create(attendee) {
|
||||
var e = new Error();
|
||||
e.fromJSON(data);
|
||||
if (e.isError()) {
|
||||
ErrorActions.serverError(e);
|
||||
dispatch(ErrorActions.serverError(e));
|
||||
} else {
|
||||
var a = new Attendee();
|
||||
a.fromJSON(data);
|
||||
@ -107,7 +107,7 @@ function create(attendee) {
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, status, error) {
|
||||
ErrorActions.ajaxError(e);
|
||||
dispatch(ErrorActions.ajaxError(e));
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -125,7 +125,7 @@ function fetchPopular() {
|
||||
var e = new Error();
|
||||
e.fromJSON(data);
|
||||
if (e.isError()) {
|
||||
ErrorActions.serverError(e);
|
||||
dispatch(ErrorActions.serverError(e));
|
||||
} else {
|
||||
dispatch(popularAttendeesFetched(data.popularattendees.map(function(json) {
|
||||
var a = new PopularAttendee();
|
||||
@ -135,7 +135,7 @@ function fetchPopular() {
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, status, error) {
|
||||
ErrorActions.ajaxError(e);
|
||||
dispatch(ErrorActions.ajaxError(e));
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -153,13 +153,13 @@ function remove(attendee) {
|
||||
var e = new Error();
|
||||
e.fromJSON(data);
|
||||
if (e.isError()) {
|
||||
ErrorActions.serverError(e);
|
||||
dispatch(ErrorActions.serverError(e));
|
||||
} else {
|
||||
dispatch(attendeeRemoved(attendee.AttendeeId));
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, status, error) {
|
||||
ErrorActions.ajaxError(e);
|
||||
dispatch(ErrorActions.ajaxError(e));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user