Define ValidationErrorResult in SpaServices; use it in MusicStore

This commit is contained in:
SteveSandersonMS
2015-12-09 17:30:35 +00:00
parent 78efc77be4
commit 906a17ea3c
5 changed files with 44 additions and 69 deletions

View File

@@ -71,7 +71,7 @@ export class AlbumEdit {
if (response.status === 200) {
this.changesSaved = true;
} else {
var errors = (<ValidationResponse>(response.json())).ModelErrors;
var errors = <ValidationResponse>(response.json());
Object.keys(errors).forEach(key => {
errors[key].forEach(errorMessage => {
// TODO: There has to be a better API for this
@@ -101,6 +101,5 @@ export class AlbumEdit {
}
interface ValidationResponse {
Message: string;
ModelErrors: { [key: string]: string[] };
[propertyName: string]: string[];
}