mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
feat: post deletion
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package useCases
|
||||
|
||||
import (
|
||||
"GoCMS/adapters/secondary/gateways"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type DeletePostUseCase struct {
|
||||
postRepository gateways.PostRepository
|
||||
}
|
||||
|
||||
func NewDeletePostUseCase(db *gorm.DB) *DeletePostUseCase {
|
||||
return &DeletePostUseCase{
|
||||
postRepository: *gateways.NewPostRepository(db),
|
||||
}
|
||||
}
|
||||
|
||||
func (g *DeletePostUseCase) DeletePost(userId uint32) error {
|
||||
return g.postRepository.Delete(userId)
|
||||
}
|
||||
Reference in New Issue
Block a user