#328432 Fix error in checking for ability to unregister and add error for unexpected count of updated registrations when changing date vote.
This commit is contained in:
Родитель
fce321acc5
Коммит
7075590b4a
|
@ -202,7 +202,7 @@ export class EventDetailsComponent implements OnInit {
|
|||
}
|
||||
|
||||
canUnregister() {
|
||||
return this.alreadyRegistered && !this.isPastEvent && this.event.OpenForRegistration && !this.event.RegistrationCompleted;
|
||||
return this.event && this.alreadyRegistered && !this.isPastEvent && this.event.OpenForRegistration && !this.event.RegistrationCompleted;
|
||||
}
|
||||
|
||||
unregister() {
|
||||
|
|
|
@ -54,7 +54,13 @@ export class EventRegistrationsService {
|
|||
|
||||
updateChoices(eventId: string, userId: string, newChoices: string[]) {
|
||||
let filter = { EventId: eventId, UserId: userId };
|
||||
return this._data.update({ Choices: newChoices }, filter);
|
||||
return this._data.update({ Choices: newChoices }, filter)
|
||||
.then(resp => {
|
||||
if (resp.result !== 1) {
|
||||
return Promise.reject({ message: 'Unexpected number of updated records - check back end' });
|
||||
}
|
||||
return resp;
|
||||
});
|
||||
}
|
||||
|
||||
create(eventId: string, userId: string, dateChoices: string[]) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче