chore: update err handler (#12)

This commit is contained in:
STEVEN
2021-12-15 10:55:17 +08:00
committed by GitHub
parent 5dc3d4a39e
commit 1fb8018f0b
11 changed files with 82 additions and 79 deletions

View File

@ -29,14 +29,14 @@ func handleGetMyMemos(w http.ResponseWriter, r *http.Request) {
})
}
type CreateMemo struct {
Content string `json:"content"`
}
func handleCreateMemo(w http.ResponseWriter, r *http.Request) {
userId, _ := GetUserIdInSession(r)
createMemo := CreateMemo{}
type CreateMemoDataBody struct {
Content string `json:"content"`
}
createMemo := CreateMemoDataBody{}
err := json.NewDecoder(r.Body).Decode(&createMemo)
if err != nil {