func (c *WorkItemCommentsController) List(ctx *app.ListWorkItemCommentsContext) error {
	offset, limit := computePagingLimts(ctx.PageOffset, ctx.PageLimit)
	return application.Transactional(c.db, func(appl application.Application) error {
		_, err := appl.WorkItems().LoadByID(ctx, ctx.WiID)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound(err.Error()))
		}

		res := &app.CommentList{}
		res.Data = []*app.Comment{}

		comments, tc, err := appl.Comments().List(ctx, ctx.WiID, &offset, &limit)
		count := int(tc)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, goa.ErrInternal(err.Error()))
		}
		res.Meta = &app.CommentListMeta{TotalCount: count}
		res.Data = ConvertComments(ctx.RequestData, comments)
		res.Links = &app.PagingLinks{}
		setPagingLinks(res.Links, buildAbsoluteURL(ctx.RequestData), len(comments), offset, limit, count)

		return ctx.OK(res)
	})
}
// List runs the list action.
List runs the list action.
// List runs the list action .
func (c *WorkItemCommentsController) List(ctx *app.ListWorkItemCommentsContext) error {
	offset, limit := computePagingLimts(ctx.PageOffset, ctx.PageLimit)
	return application.Transactional(c.db, func(appl application.Application) error {
		_, err := appl.WorkItems().LoadByID(ctx, ctx.WiID)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound(err.Error()))
		}
		res := &app.CommentList{}
		res.Data = []*app.Comment{}
		comments, tc, err := appl.Comments().List(ctx, ctx.WiID, &offset, &limit)
		count := int(tc)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, goa.ErrInternal(err.Error()))
		}
		res.Meta = &app.CommentListMeta{TotalCount: count}
		res.Data = ConvertComments(ctx.RequestData, comments)
		res.Links = &app.PagingLinks{}
		setPagingLinks(res.Links, buildAbsoluteURL(ctx.RequestData), len(comments), offset, limit, count)
		return ctx.OK(res)
	})
}
func ( c * WorkItemCommentsController ) List ( ctx * app . ListWorkItemCommentsContext ) error { offset , limit := computePagingLimts ( ctx . PageOffset , ctx . PageLimit ) return application . Transactional ( c . db , func ( appl application . Application ) error { _ , err := appl . WorkItems ( ) . LoadByID ( ctx , ctx . WiID ) if err != nil { return jsonapi . JSONErrorResponse ( ctx , goa . ErrNotFound ( err . Error ( ) ) ) } res := & app . CommentList { } res . Data = [ ] * app . Comment { } comments , tc , err := appl . Comments ( ) . List ( ctx , ctx . WiID , & offset , & limit ) count := int ( tc ) if err != nil { return jsonapi . JSONErrorResponse ( ctx , goa . ErrInternal ( err . Error ( ) ) ) } res . Meta = & app . CommentListMeta { TotalCount : count } res . Data = ConvertComments ( ctx . RequestData , comments ) res . Links = & app . PagingLinks { } setPagingLinks ( res . Links , buildAbsoluteURL ( ctx . RequestData ) , len ( comments ) , offset , limit , count ) return ctx . OK ( res ) } ) }
List runs the list action.
List runs the list action .