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

		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()))
		}
		_ = wi
		_ = comments
		res := &app.CommentRelationshipList{}
		res.Meta = &app.CommentListMeta{TotalCount: count}
		res.Data = ConvertCommentsResourceID(ctx.RequestData, comments)
		res.Links = CreateCommentsRelationLinks(ctx.RequestData, wi)

		return ctx.OK(res)
	})
}
// Relations runs the relation action.
// TODO: Should only return Resource Identifier Objects, not complete object (See List)
Relations runs the relation action.
TODO: Should only return Resource Identifier Objects, not complete object (See List)
// Relations runs the relation action . // TODO : Should only return Resource Identifier Objects not complete object ( See List )
func (c *WorkItemCommentsController) Relations(ctx *app.RelationsWorkItemCommentsContext) error {
	offset, limit := computePagingLimts(ctx.PageOffset, ctx.PageLimit)
	return application.Transactional(c.db, func(appl application.Application) error {
		wi, err := appl.WorkItems().LoadByID(ctx, ctx.WiID)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound(err.Error()))
		}
		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()))
		}
		_ = wi
		_ = comments
		res := &app.CommentRelationshipList{}
		res.Meta = &app.CommentListMeta{TotalCount: count}
		res.Data = ConvertCommentsResourceID(ctx.RequestData, comments)
		res.Links = CreateCommentsRelationLinks(ctx.RequestData, wi)
		return ctx.OK(res)
	})
}
func ( c * WorkItemCommentsController ) Relations ( ctx * app . RelationsWorkItemCommentsContext ) error { offset , limit := computePagingLimts ( ctx . PageOffset , ctx . PageLimit ) return application . Transactional ( c . db , func ( appl application . Application ) error { wi , err := appl . WorkItems ( ) . LoadByID ( ctx , ctx . WiID ) if err != nil { return jsonapi . JSONErrorResponse ( ctx , goa . ErrNotFound ( err . Error ( ) ) ) } 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 ( ) ) ) } _ = wi _ = comments res := & app . CommentRelationshipList { } res . Meta = & app . CommentListMeta { TotalCount : count } res . Data = ConvertCommentsResourceID ( ctx . RequestData , comments ) res . Links = CreateCommentsRelationLinks ( ctx . RequestData , wi ) return ctx . OK ( res ) } ) }
Relations runs the relation action.
Relations runs the relation action .