10-WebsiteModel #13
@ -1,6 +1,5 @@
|
||||
package main
|
||||
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
@ -83,6 +82,10 @@ func (app *application) getGuestbookDashboard(w http.ResponseWriter, r *http.Req
|
||||
}
|
||||
return
|
||||
}
|
||||
user := app.getCurrentUser(r)
|
||||
if user.ID != guestbook.UserId {
|
||||
app.clientError(w, http.StatusUnauthorized)
|
||||
}
|
||||
comments, err := app.guestbookComments.GetAll(guestbook.ID)
|
||||
if err != nil {
|
||||
app.serverError(w, r, err)
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
type User struct {
|
||||
ID int
|
||||
ID int64
|
||||
ShortId uint64
|
||||
Username string
|
||||
Email string
|
||||
|
Loading…
x
Reference in New Issue
Block a user