finish setup data insertion, add world insertion

This commit is contained in:
lbenedar
2026-04-22 18:18:43 +03:00
parent 21abe68858
commit f46ff8333e
66 changed files with 2257 additions and 676 deletions

View File

@@ -14,17 +14,21 @@ type Journal struct {
// Categories []any `json:"categories"`
}
func (j *Journal) ToDB(dest *db.Journal) bool {
func (j *Journal) ToDB(dest **db.Journal) bool {
if dest == nil {
return false
}
dest.Name = j.Name
dest.Sort = j.Sort
dest.ID = j.ID
journal := &db.Journal{
Name: j.Name,
Sort: j.Sort,
ID: j.ID,
}
OwnershipToDB(&dest.Ownership, j.Ownership)
CopySliceToDB(&dest.Pages, j.Pages)
OwnershipToDB(&journal.Ownership, j.Ownership)
CopySliceToDB(&journal.Pages, j.Pages)
*dest = journal
return true
}