WIP first entry creation

This commit is contained in:
Niko Abeler 2023-07-06 19:42:54 +02:00
parent ff193f62e9
commit 8fc82b86a3
4 changed files with 9 additions and 1 deletions

3
.gitignore vendored
View File

@ -24,3 +24,6 @@ users/
.vscode/
*.swp
*.db

View File

@ -2,6 +2,7 @@ package main
import (
"owl-blogs/app"
"owl-blogs/domain/model"
"owl-blogs/infra"
"owl-blogs/web"
)
@ -9,6 +10,9 @@ import (
func main() {
db := infra.NewSqliteDB("owlblogs.db")
registry := app.NewEntryTypeRegistry()
registry.Register(&model.ImageEntry{})
repo := infra.NewEntryRepository(db, registry)
entryService := app.NewEntryService(repo)
webApp := web.NewWebApp(entryService)

Binary file not shown.

View File

@ -39,7 +39,8 @@ func (h *EditorHandler) HandlePost(c *fiber.Ctx) error {
// create entry
now := time.Now()
err = h.entrySvc.Create(&model.ImageEntry{}, &now, metaData)
entry := &model.ImageEntry{}
err = h.entrySvc.Create(entry, &now, metaData.MetaData())
if err != nil {
return err
}