func (c *SpaceCodebasesController) List(ctx *app.ListSpaceCodebasesContext) error {
	offset, limit := computePagingLimts(ctx.PageOffset, ctx.PageLimit)
	spaceID, err := uuid.FromString(ctx.ID)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound(err.Error()))
	}
	return application.Transactional(c.db, func(appl application.Application) error {
		_, err = appl.Spaces().Load(ctx, spaceID)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound(err.Error()))
		}

		res := &app.CodebaseList{}
		res.Data = []*app.Codebase{}

		codebases, tc, err := appl.Codebases().List(ctx, spaceID, &offset, &limit)
		count := int(tc)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, goa.ErrInternal(err.Error()))
		}
		res.Meta = &app.CodebaseListMeta{TotalCount: count}
		res.Data = ConvertCodebases(ctx.RequestData, codebases)
		res.Links = &app.PagingLinks{}
		setPagingLinks(res.Links, buildAbsoluteURL(ctx.RequestData), len(codebases), offset, limit, count)

		return ctx.OK(res)
	})
}
// List runs the list action.
List runs the list action.
// List runs the list action .
func (c *SpaceCodebasesController) List(ctx *app.ListSpaceCodebasesContext) error {
	offset, limit := computePagingLimts(ctx.PageOffset, ctx.PageLimit)
	spaceID, err := uuid.FromString(ctx.ID)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound(err.Error()))
	}
	return application.Transactional(c.db, func(appl application.Application) error {
		_, err = appl.Spaces().Load(ctx, spaceID)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, goa.ErrNotFound(err.Error()))
		}
		res := &app.CodebaseList{}
		res.Data = []*app.Codebase{}
		codebases, tc, err := appl.Codebases().List(ctx, spaceID, &offset, &limit)
		count := int(tc)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, goa.ErrInternal(err.Error()))
		}
		res.Meta = &app.CodebaseListMeta{TotalCount: count}
		res.Data = ConvertCodebases(ctx.RequestData, codebases)
		res.Links = &app.PagingLinks{}
		setPagingLinks(res.Links, buildAbsoluteURL(ctx.RequestData), len(codebases), offset, limit, count)
		return ctx.OK(res)
	})
}
func ( c * SpaceCodebasesController ) List ( ctx * app . ListSpaceCodebasesContext ) error { offset , limit := computePagingLimts ( ctx . PageOffset , ctx . PageLimit ) spaceID , err := uuid . FromString ( ctx . ID ) if err != nil { return jsonapi . JSONErrorResponse ( ctx , goa . ErrNotFound ( err . Error ( ) ) ) } return application . Transactional ( c . db , func ( appl application . Application ) error { _ , err = appl . Spaces ( ) . Load ( ctx , spaceID ) if err != nil { return jsonapi . JSONErrorResponse ( ctx , goa . ErrNotFound ( err . Error ( ) ) ) } res := & app . CodebaseList { } res . Data = [ ] * app . Codebase { } codebases , tc , err := appl . Codebases ( ) . List ( ctx , spaceID , & offset , & limit ) count := int ( tc ) if err != nil { return jsonapi . JSONErrorResponse ( ctx , goa . ErrInternal ( err . Error ( ) ) ) } res . Meta = & app . CodebaseListMeta { TotalCount : count } res . Data = ConvertCodebases ( ctx . RequestData , codebases ) res . Links = & app . PagingLinks { } setPagingLinks ( res . Links , buildAbsoluteURL ( ctx . RequestData ) , len ( codebases ) , offset , limit , count ) return ctx . OK ( res ) } ) }
List runs the list action.
List runs the list action .