feat: remove foreign key and triggers (#345)

This commit is contained in:
boojack
2022-10-26 23:00:09 +08:00
committed by GitHub
parent 4e00b1b0cd
commit 9705406b82
12 changed files with 161 additions and 207 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"net/http"
"strconv"
"time"
"github.com/usememos/memos/api"
"github.com/usememos/memos/common"
@@ -185,8 +186,10 @@ func (s *Server) registerUserRoutes(g *echo.Group) {
return echo.NewHTTPError(http.StatusForbidden, "Access forbidden for current session user").SetInternal(err)
}
currentTs := time.Now().Unix()
userPatch := &api.UserPatch{
ID: userID,
ID: userID,
UpdatedTs: &currentTs,
}
if err := json.NewDecoder(c.Request().Body).Decode(userPatch); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, "Malformatted patch user request").SetInternal(err)