Merge pull request #9 from devadomas/master
fix on CreateBook errored NewBook unaccessible property
This commit is contained in:
@@ -23,7 +23,7 @@ func NewService(r Repository) *Service {
|
||||
func (s *Service) CreateBook(title string, author string, pages int, quantity int) (entity.ID, error) {
|
||||
b, err := entity.NewBook(title, author, pages, quantity)
|
||||
if err != nil {
|
||||
return b.ID, err
|
||||
return entity.NewID(), err
|
||||
}
|
||||
return s.repo.Create(b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user