feat: Sites feature backend
This commit is contained in:
1 parent
45fcbd890d
commit
a11338094e
98 files changed
+5365
-214
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package useCases
|
||||
|
||||
import "RenewCMS/internal/domain/site"
|
||||
|
||||
func siteImageUsage(sites site.Repository) (map[uint32]int, error) {
|
||||
usage := map[uint32]int{}
|
||||
all, err := sites.List()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, s := range all {
|
||||
if s.DefaultSocialImageID != nil {
|
||||
usage[*s.DefaultSocialImageID]++
|
||||
}
|
||||
}
|
||||
return usage, nil
|
||||
}
|
||||
Reference in new issue
Block a user