mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
feat: post edition save
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user