Skip to content
Snippets Groups Projects
Commit 2c478b62 authored by guoguo.yu's avatar guoguo.yu :speech_balloon:
Browse files

messageGet works properly database wise

parent d7614158
No related branches found
No related tags found
No related merge requests found
...@@ -345,6 +345,27 @@ func successSignin(w http.ResponseWriter, r *http.Request) { ...@@ -345,6 +345,27 @@ func successSignin(w http.ResponseWriter, r *http.Request) {
return return
} }
fmt.Println(messages) fmt.Println(messages)
// Render the profile page with the user's messages
tmpl, err := template.ParseFiles("./view/profile.html")
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
err = tmpl.Execute(w, struct {
User models.User
Messages []models.Post
FullName string
Email string
}{
User: user,
Messages: messages,
FullName: user.FullName,
Email: user.Email,
})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment