Close all sessions after using them
This commit is contained in:
parent
6fa2fb5872
commit
a897a6def6
|
@ -73,6 +73,11 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error {
|
||||||
return HandleHTTPError(err, ctx)
|
return HandleHTTPError(err, ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = s.Close()
|
||||||
|
if err != nil {
|
||||||
|
return HandleHTTPError(err, ctx)
|
||||||
|
}
|
||||||
|
|
||||||
err = ctx.JSON(http.StatusCreated, currentStruct)
|
err = ctx.JSON(http.StatusCreated, currentStruct)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return HandleHTTPError(err, ctx)
|
return HandleHTTPError(err, ctx)
|
||||||
|
|
|
@ -71,6 +71,11 @@ func (c *WebHandler) DeleteWeb(ctx echo.Context) error {
|
||||||
return HandleHTTPError(err, ctx)
|
return HandleHTTPError(err, ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = s.Close()
|
||||||
|
if err != nil {
|
||||||
|
return HandleHTTPError(err, ctx)
|
||||||
|
}
|
||||||
|
|
||||||
err = ctx.JSON(http.StatusOK, message{"Successfully deleted."})
|
err = ctx.JSON(http.StatusOK, message{"Successfully deleted."})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return HandleHTTPError(err, ctx)
|
return HandleHTTPError(err, ctx)
|
||||||
|
|
|
@ -113,6 +113,11 @@ func (c *WebHandler) ReadAllWeb(ctx echo.Context) error {
|
||||||
return HandleHTTPError(err, ctx)
|
return HandleHTTPError(err, ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = s.Close()
|
||||||
|
if err != nil {
|
||||||
|
return HandleHTTPError(err, ctx)
|
||||||
|
}
|
||||||
|
|
||||||
err = ctx.JSON(http.StatusOK, result)
|
err = ctx.JSON(http.StatusOK, result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return HandleHTTPError(err, ctx)
|
return HandleHTTPError(err, ctx)
|
||||||
|
|
|
@ -74,6 +74,11 @@ func (c *WebHandler) ReadOneWeb(ctx echo.Context) error {
|
||||||
return HandleHTTPError(err, ctx)
|
return HandleHTTPError(err, ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = s.Close()
|
||||||
|
if err != nil {
|
||||||
|
return HandleHTTPError(err, ctx)
|
||||||
|
}
|
||||||
|
|
||||||
err = ctx.JSON(http.StatusOK, currentStruct)
|
err = ctx.JSON(http.StatusOK, currentStruct)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return HandleHTTPError(err, ctx)
|
return HandleHTTPError(err, ctx)
|
||||||
|
|
|
@ -73,6 +73,11 @@ func (c *WebHandler) UpdateWeb(ctx echo.Context) error {
|
||||||
return HandleHTTPError(err, ctx)
|
return HandleHTTPError(err, ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = s.Close()
|
||||||
|
if err != nil {
|
||||||
|
return HandleHTTPError(err, ctx)
|
||||||
|
}
|
||||||
|
|
||||||
err = ctx.JSON(http.StatusOK, currentStruct)
|
err = ctx.JSON(http.StatusOK, currentStruct)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return HandleHTTPError(err, ctx)
|
return HandleHTTPError(err, ctx)
|
||||||
|
|
Loading…
Reference in New Issue