feat: update
This commit is contained in:
@@ -3,7 +3,6 @@ package admin
|
||||
import (
|
||||
"quyun/app/model"
|
||||
"quyun/app/requests"
|
||||
"quyun/database/conds"
|
||||
"quyun/database/fields"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
@@ -23,10 +22,10 @@ type posts struct{}
|
||||
// @Bind pagination query
|
||||
// @Bind query query
|
||||
func (ctl *posts) List(ctx fiber.Ctx, pagination *requests.Pagination, query *ListQuery) (*requests.Pager, error) {
|
||||
conds := []conds.Cond{
|
||||
conds := []model.Cond{
|
||||
// conds.Post_NotDeleted(),
|
||||
// conds.Post_Status(fields.PostStatusPublished),
|
||||
conds.Post_Like(query.Keyword),
|
||||
model.PostsModel().CondLike(query.Keyword),
|
||||
}
|
||||
pager, err := model.PostsModel().List(ctx.Context(), pagination, conds...)
|
||||
if err != nil {
|
||||
@@ -158,7 +157,7 @@ func (ctl *posts) Delete(ctx fiber.Ctx, id int64) error {
|
||||
return fiber.ErrNotFound
|
||||
}
|
||||
|
||||
if err := post.Delete(ctx.Context()); err != nil {
|
||||
if err := post.ForceDelete(ctx.Context()); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user