package category

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

	"server/api/category/v1"
)

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