mirror of
https://github.com/dnote/dnote
synced 2026-03-16 07:25:49 +01:00
Implement MVC
This commit is contained in:
parent
172f608b66
commit
cd5d094c25
146 changed files with 13596 additions and 2328 deletions
|
|
@ -28,7 +28,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/dnote/dnote/pkg/server/database"
|
||||
"github.com/dnote/dnote/pkg/server/handlers"
|
||||
"github.com/dnote/dnote/pkg/server/middleware"
|
||||
"github.com/dnote/dnote/pkg/server/operations"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
|
@ -52,12 +52,12 @@ type notePage struct {
|
|||
}
|
||||
|
||||
func (a AppShell) newNotePage(r *http.Request, noteUUID string) (notePage, error) {
|
||||
user, _, err := handlers.AuthWithSession(a.DB, r, nil)
|
||||
user, _, err := middleware.AuthWithSession(a.DB, r)
|
||||
if err != nil {
|
||||
return notePage{}, errors.Wrap(err, "authenticating with session")
|
||||
}
|
||||
|
||||
note, ok, err := operations.GetNote(a.DB, noteUUID, user)
|
||||
note, ok, err := operations.GetNote(a.DB, noteUUID, &user)
|
||||
|
||||
if !ok {
|
||||
return notePage{}, ErrNotFound
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue