Added keyboard shortcuts for post editing.
This commit is contained in:
parent
4f7058bf36
commit
44d35c6ccb
13 changed files with 215 additions and 28 deletions
|
|
@ -13,6 +13,7 @@ func AuthUser() func(c fiber.Ctx) error {
|
|||
user := models.User{
|
||||
ID: 1,
|
||||
Username: "testuser",
|
||||
TimeZone: "Australia/Melbourne",
|
||||
}
|
||||
|
||||
c.Locals("user", user)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ func (ph PostsHandler) Index(c fiber.Ctx) error {
|
|||
|
||||
func (ph PostsHandler) New(c fiber.Ctx) error {
|
||||
p := models.Post{
|
||||
GUID: models.NewNanoID(),
|
||||
GUID: models.NewNanoID(),
|
||||
State: models.StateDraft,
|
||||
}
|
||||
|
||||
return c.Render("posts/edit", fiber.Map{
|
||||
|
|
@ -77,7 +78,7 @@ func (ph PostsHandler) Update(c fiber.Ctx) error {
|
|||
return err
|
||||
}
|
||||
|
||||
post, err := ph.PostService.PublishPost(c.Context(), req)
|
||||
post, err := ph.PostService.UpdatePost(c.Context(), req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue