mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-16 12:23:12 +00:00
fix: delete workspace user
This commit is contained in:
parent
a175ef47e2
commit
a97fe9d81f
@ -159,10 +159,9 @@ func (s *Server) registerWorkspaceUserRoutes(g *echo.Group) {
|
||||
WorkspaceID: &workspaceID,
|
||||
}
|
||||
if err := s.Store.DeleteShortcut(ctx, shortcutDelete); err != nil {
|
||||
if common.ErrorCode(err) == common.NotFound {
|
||||
return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Shortcut not found with workspace id %d and user id %d", workspaceID, userID))
|
||||
if common.ErrorCode(err) != common.NotFound {
|
||||
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to delete shortcut").SetInternal(err)
|
||||
}
|
||||
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to delete shortcut").SetInternal(err)
|
||||
}
|
||||
|
||||
return c.JSON(http.StatusOK, true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user