Skip to content

Commit

Permalink
fix: partial updates for db failure
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Mar 29, 2024
1 parent af69ed7 commit eadac17
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/chain/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func insert(c *fiber.Ctx) error {

result, err := utils.QueryRow[ChainModel](c, InsertChain, map[string]any{"name": payload.Name})
if err != nil {
panic(err)
return c.Status(fiber.StatusInternalServerError).SendString("failed to insert chain: " + err.Error())
}

return c.JSON(result)
Expand Down
2 changes: 1 addition & 1 deletion api/proxy/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func insert(c *fiber.Ctx) error {
"port": payload.Port,
"location": &payload.Location})
if err != nil {
panic(err)
return c.Status(fiber.StatusInternalServerError).SendString("failed to insert proxy: " + err.Error())
}

return c.JSON(result)
Expand Down
2 changes: 1 addition & 1 deletion api/service/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func insert(c *fiber.Ctx) error {

result, err := utils.QueryRow[ServiceModel](c, InsertService, map[string]any{"name": payload.Name})
if err != nil {
panic(err)
return c.Status(fiber.StatusInternalServerError).SendString("failed to insert service: " + err.Error())
}

return c.JSON(result)
Expand Down

0 comments on commit eadac17

Please sign in to comment.