fixed validations
This commit is contained in:
		
							parent
							
								
									3a3e5bdac6
								
							
						
					
					
						commit
						fe2c6bfe02
					
				| @ -1,6 +1,6 @@ | ||||
| { | ||||
|   "name": "@poweredsoft/ngx-data", | ||||
|   "version": "0.0.15", | ||||
|   "version": "0.0.16", | ||||
|   "peerDependencies": { | ||||
|     "@angular/common": "^8.2.4", | ||||
|     "@angular/core": "^8.2.4", | ||||
|  | ||||
| @ -101,7 +101,14 @@ export class HttpDataSourceOptionsBuilder<TModel, TKey> { | ||||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         if (typeof(err.error) == "object") { | ||||
|         if (err.status == 400)  | ||||
|         { | ||||
|             if (err.error && err.error.errors) | ||||
|                 return throwError(<IDataSourceValidationError>{ | ||||
|                     type: 'validation', | ||||
|                     errors: err.error.errors | ||||
|                 }); | ||||
| 
 | ||||
|             // if status not okay then its an exception error
 | ||||
|             if (err.error.hasOwnProperty('Message') && typeof(err.error['Message']) == "string") { | ||||
|                 return throwError(<IDataSourceErrorMessage>{ | ||||
| @ -109,11 +116,6 @@ export class HttpDataSourceOptionsBuilder<TModel, TKey> { | ||||
|                     message: err.error['Message'] | ||||
|                 }); | ||||
|             } | ||||
| 
 | ||||
|             return throwError(<IDataSourceValidationError>{ | ||||
|                 type: 'validation', | ||||
|                 errors: err.error.errors | ||||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         // general error message
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user