package chapter

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/chapter/v1"
)

func (c *ControllerV1) Del(ctx context.Context, req *v1.DelReq) (res *v1.DelRes, err error) {
	out, err := service.Chapter().Delete(ctx, &model.ChapterDelIn{
		Id: req.Id,
	})
	if err != nil {
		return nil, err
	}
	return &v1.DelRes{Success: out.Success}, nil
}
