fix on new book unaccessible property

This commit is contained in:
Adomas
2021-01-10 18:24:37 +02:00
parent 6eb9e6bbf2
commit 2b34d188c2
+1 -1
View File
@@ -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)
}