add post userbook
needed a refactor to check the id in db during dto validation
This commit is contained in:
13
internal/mapper/userbookpostcreate.go
Normal file
13
internal/mapper/userbookpostcreate.go
Normal 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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user