add "Added By" for books

This commit is contained in:
2025-10-08 15:34:31 +02:00
parent fc31cc5507
commit c9991118ee
4 changed files with 52 additions and 34 deletions

View File

@@ -5,10 +5,11 @@ import (
"golang.org/x/crypto/bcrypt"
)
func (b bookPostCreate) toBook() model.Book {
func (b bookPostCreate) toBook(user *model.User) model.Book {
return model.Book{
Title: b.Title,
Author: b.Author,
Title: b.Title,
Author: b.Author,
AddedBy: *user,
}
}