feat: post edition save

This commit is contained in:
Florian Sylvain
2024-05-18 12:24:54 +02:00
parent 900ad3e8b8
commit 92c6d06d00
8 changed files with 115 additions and 24 deletions
+20
View File
@@ -0,0 +1,20 @@
package useCases
import (
"GoCMS/adapters/secondary/gateways"
"gorm.io/gorm"
)
type UpdatePostUseCase struct {
postRepository gateways.PostRepository
}
func NewUpdatePostUseCase(db *gorm.DB) *UpdatePostUseCase {
return &UpdatePostUseCase{
postRepository: *gateways.NewPostRepository(db),
}
}
func (g *UpdatePostUseCase) UpdateBody(id uint32, body string) error {
return g.postRepository.UpdateBody(id, body)
}