add post userbook

needed a refactor to check the id in db during dto validation
This commit is contained in:
2025-10-17 01:13:35 +02:00
parent 7dcca84b7d
commit 9404013592
11 changed files with 157 additions and 30 deletions

View File

@@ -0,0 +1,13 @@
package mapper
import (
"git.artlef.fr/PersonalLibraryManager/internal/dto"
"git.artlef.fr/PersonalLibraryManager/internal/model"
)
func UserBookWsToDb(ub dto.UserBookPostCreate, user *model.User) model.UserBook {
return model.UserBook{
UserID: user.ID,
BookID: ub.BookID,
}
}