Tweak SimpleRequestMixin to not rely on response.data.ok
				
					
				
			instead just assume ok unless `response.data.error` is set
This commit is contained in:
		
							parent
							
								
									ba2b4bf12c
								
							
						
					
					
						commit
						105dab7a3d
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -47,10 +47,7 @@ | |||
| 
 | ||||
|                 this.$http.post(action, params, {headers: headers}).then(response => { | ||||
| 
 | ||||
|                     if (response.data.ok) { | ||||
|                         success(response) | ||||
| 
 | ||||
|                     } else { | ||||
|                     if (response.data.error) { | ||||
|                         this.$buefy.toast.open({ | ||||
|                             message: "Submit failed:  " + (response.data.error || | ||||
|                                                            "(unknown error)"), | ||||
|  | @ -60,6 +57,9 @@ | |||
|                         if (failure) { | ||||
|                             failure(response) | ||||
|                         } | ||||
| 
 | ||||
|                     } else { | ||||
|                         success(response) | ||||
|                     } | ||||
| 
 | ||||
|                 }, response => { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar