Returning nil on delete, fix species test
This commit is contained in:
		
							parent
							
								
									eb7c778be8
								
							
						
					
					
						commit
						a669cf8d93
					
				
					 3 changed files with 3 additions and 2 deletions
				
			
		|  | @ -90,5 +90,5 @@ func serveDeleteGenus(w http.ResponseWriter, r *http.Request) error { | ||||||
| 		w.WriteHeader(http.StatusOK) | 		w.WriteHeader(http.StatusOK) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	return writeJSON(w, &models.Genus{}) | 	return writeJSON(w, nil) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -88,7 +88,7 @@ func serveDeleteSpecies(w http.ResponseWriter, r *http.Request) error { | ||||||
| 		w.WriteHeader(http.StatusOK) | 		w.WriteHeader(http.StatusOK) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	return writeJSON(w, &models.Species{}) | 	return writeJSON(w, nil) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func serveSubrouterSpeciesList(w http.ResponseWriter, r *http.Request) error { | func serveSubrouterSpeciesList(w http.ResponseWriter, r *http.Request) error { | ||||||
|  |  | ||||||
|  | @ -156,6 +156,7 @@ func TestSpeciesService_Delete(t *testing.T) { | ||||||
| 	mux.HandleFunc(urlPath(t, router.DeleteSpecies, map[string]string{"Id": "1"}), func(w http.ResponseWriter, r *http.Request) { | 	mux.HandleFunc(urlPath(t, router.DeleteSpecies, map[string]string{"Id": "1"}), func(w http.ResponseWriter, r *http.Request) { | ||||||
| 		called = true | 		called = true | ||||||
| 		testMethod(t, r, "DELETE") | 		testMethod(t, r, "DELETE") | ||||||
|  | 		testBody(t, r, "") | ||||||
| 
 | 
 | ||||||
| 		w.WriteHeader(http.StatusOK) | 		w.WriteHeader(http.StatusOK) | ||||||
| 		writeJSON(w, want) | 		writeJSON(w, want) | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Matthew Dillon
						Matthew Dillon