func enrichLinkTypeSingle(ctx *workItemLinkContext, single *app.WorkItemLinkTypeSingle) error {
	// Add "links" element
	selfURL := rest.AbsoluteURL(ctx.RequestData, ctx.LinkFunc(*single.Data.ID))
	single.Data.Links = &app.GenericLinks{
		Self: &selfURL,
	}

	// Now include the optional link category data in the work item link type "included" array
	modelCategory, err := ctx.Application.WorkItemLinkCategories().Load(ctx.Context, single.Data.Relationships.LinkCategory.Data.ID)
	if err != nil {
		jerrors, httpStatusCode := jsonapi.ErrorToJSONAPIErrors(err)
		return ctx.ResponseData.Service.Send(ctx.Context, httpStatusCode, jerrors)

	}
	appCategory := convertLinkCategoryFromModel(*modelCategory)
	single.Included = append(single.Included, appCategory.Data)

	// Now include the optional link space data in the work item link type "included" array
	space, err := ctx.Application.Spaces().Load(ctx.Context, *single.Data.Relationships.Space.Data.ID)
	if err != nil {
		jerrors, httpStatusCode := jsonapi.ErrorToJSONAPIErrors(err)
		return ctx.ResponseData.Service.Send(ctx.Context, httpStatusCode, jerrors)
	}

	spaceData, err := ConvertSpaceFromModel(ctx.Context, ctx.DB, ctx.RequestData, *space)
	if err != nil {
		jerrors, httpStatusCode := jsonapi.ErrorToJSONAPIErrors(err)
		return ctx.ResponseData.Service.Send(ctx.Context, httpStatusCode, jerrors)
	}
	spaceSingle := &app.SpaceSingle{
		Data: spaceData,
	}
	single.Included = append(single.Included, spaceSingle.Data)

	return nil
}
// enrichLinkTypeSingle includes related resources in the single's "included" array
enrichLinkTypeSingle includes related resources in the single's "included" array
// enrichLinkTypeSingle includes related resources in the single ' s " included " array
func enrichLinkTypeSingle(ctx *workItemLinkContext, single *app.WorkItemLinkTypeSingle) error {
	selfURL := rest.AbsoluteURL(ctx.RequestData, ctx.LinkFunc(*single.Data.ID))
	single.Data.Links = &app.GenericLinks{
		Self: &selfURL,
	}
	modelCategory, err := ctx.Application.WorkItemLinkCategories().Load(ctx.Context, single.Data.Relationships.LinkCategory.Data.ID)
	if err != nil {
		jerrors, httpStatusCode := jsonapi.ErrorToJSONAPIErrors(err)
		return ctx.ResponseData.Service.Send(ctx.Context, httpStatusCode, jerrors)
	}
	appCategory := convertLinkCategoryFromModel(*modelCategory)
	single.Included = append(single.Included, appCategory.Data)
	space, err := ctx.Application.Spaces().Load(ctx.Context, *single.Data.Relationships.Space.Data.ID)
	if err != nil {
		jerrors, httpStatusCode := jsonapi.ErrorToJSONAPIErrors(err)
		return ctx.ResponseData.Service.Send(ctx.Context, httpStatusCode, jerrors)
	}
	spaceData, err := ConvertSpaceFromModel(ctx.Context, ctx.DB, ctx.RequestData, *space)
	if err != nil {
		jerrors, httpStatusCode := jsonapi.ErrorToJSONAPIErrors(err)
		return ctx.ResponseData.Service.Send(ctx.Context, httpStatusCode, jerrors)
	}
	spaceSingle := &app.SpaceSingle{
		Data: spaceData,
	}
	single.Included = append(single.Included, spaceSingle.Data)
	return nil
}
func enrichLinkTypeSingle ( ctx * workItemLinkContext , single * app . WorkItemLinkTypeSingle ) error { selfURL := rest . AbsoluteURL ( ctx . RequestData , ctx . LinkFunc ( * single . Data . ID ) ) single . Data . Links = & app . GenericLinks { Self : & selfURL , } modelCategory , err := ctx . Application . WorkItemLinkCategories ( ) . Load ( ctx . Context , single . Data . Relationships . LinkCategory . Data . ID ) if err != nil { jerrors , httpStatusCode := jsonapi . ErrorToJSONAPIErrors ( err ) return ctx . ResponseData . Service . Send ( ctx . Context , httpStatusCode , jerrors ) } appCategory := convertLinkCategoryFromModel ( * modelCategory ) single . Included = append ( single . Included , appCategory . Data ) space , err := ctx . Application . Spaces ( ) . Load ( ctx . Context , * single . Data . Relationships . Space . Data . ID ) if err != nil { jerrors , httpStatusCode := jsonapi . ErrorToJSONAPIErrors ( err ) return ctx . ResponseData . Service . Send ( ctx . Context , httpStatusCode , jerrors ) } spaceData , err := ConvertSpaceFromModel ( ctx . Context , ctx . DB , ctx . RequestData , * space ) if err != nil { jerrors , httpStatusCode := jsonapi . ErrorToJSONAPIErrors ( err ) return ctx . ResponseData . Service . Send ( ctx . Context , httpStatusCode , jerrors ) } spaceSingle := & app . SpaceSingle { Data : spaceData , } single . Included = append ( single . Included , spaceSingle . Data ) return nil }
enrichLinkTypeSingle includes related resources in the single's "included" array
enrichLinkTypeSingle includes related resources in the single ' s " included " array
// Add "links" element // Now include the optional link category data in the work item link type "included" array // Now include the optional link space data in the work item link type "included" array