feat(API): media field type
This commit is contained in:
1 parent
ad5faf3d19
commit
a2d596f4ca
63 files changed
+2567
-259
No files matched your search
@@ -3,15 +3,17 @@ package useCases
|
||||
import (
|
||||
"RenewCMS/internal/domain/contenttype"
|
||||
"RenewCMS/internal/domain/entry"
|
||||
"RenewCMS/internal/domain/image"
|
||||
)
|
||||
|
||||
type GetEntryUseCase struct {
|
||||
contentTypes contenttype.Repository
|
||||
entries entry.Repository
|
||||
images image.Repository
|
||||
}
|
||||
|
||||
func NewGetEntryUseCase(contentTypes contenttype.Repository, entries entry.Repository) *GetEntryUseCase {
|
||||
return &GetEntryUseCase{contentTypes, entries}
|
||||
func NewGetEntryUseCase(contentTypes contenttype.Repository, entries entry.Repository, images image.Repository) *GetEntryUseCase {
|
||||
return &GetEntryUseCase{contentTypes, entries, images}
|
||||
}
|
||||
|
||||
func (u *GetEntryUseCase) Get(contentTypeKey string, id uint32) (TypedEntry, error) {
|
||||
@@ -23,5 +25,5 @@ func (u *GetEntryUseCase) Get(contentTypeKey string, id uint32) (TypedEntry, err
|
||||
if err != nil {
|
||||
return TypedEntry{}, err
|
||||
}
|
||||
return typedEntry(owner, found), nil
|
||||
return typedEntry(owner, found, newMediaResolver(u.images))
|
||||
}
|
||||
Reference in new issue
Block a user