import from Fuelly complete

This commit is contained in:
Akhil Gupta
2021-06-27 11:04:58 +05:30
parent 5f96345828
commit f851a2dc19
10 changed files with 247 additions and 22 deletions

View File

@@ -17,9 +17,9 @@ func fuellyImport(c *gin.Context) {
c.JSON(http.StatusUnprocessableEntity, err)
return
}
err = service.FuellyImport(bytes, c.MustGet("userId").(string))
if err != nil {
c.JSON(http.StatusUnprocessableEntity, gin.H{"errors": err.Error()})
errors := service.FuellyImport(bytes, c.MustGet("userId").(string))
if len(errors) > 0 {
c.JSON(http.StatusUnprocessableEntity, gin.H{"errors": errors})
return
}
c.JSON(http.StatusOK, gin.H{})