Add testing endpoint to reset db tables #716

Merged
konrad merged 4 commits from feature/testing-token into master 2020-11-28 23:08:31 +00:00
1 changed files with 4 additions and 1 deletions
Showing only changes of commit 5db53cf8ef - Show all commits

View File

@ -51,7 +51,10 @@ func HandleTesting(c echo.Context) error {
content := []map[string]interface{}{}
err := json.Unmarshal(buf.Bytes(), &content)
if err != nil {
return c.JSON(http.StatusInternalServerError, err)
return c.JSON(http.StatusInternalServerError, map[string]interface{}{
"error": true,
"message": err.Error(),
})
}
err = db.RestoreAndTruncate(table, content)