func (c *SpaceController) Show(ctx *app.ShowSpaceContext) error {
	id, 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 {
		s, err := appl.Spaces().Load(ctx.Context, id)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, err)
		}

		return ctx.ConditionalEntity(*s, c.config.GetCacheControlSpace, func() error {
			spaceData, err := ConvertSpaceFromModel(ctx.Context, c.db, ctx.RequestData, *s)
			if err != nil {
				return jsonapi.JSONErrorResponse(ctx, err)
			}
			result := app.SpaceSingle{
				Data: spaceData,
			}
			return ctx.OK(&result)
		})
	})
}
// Show runs the show action.
Show runs the show action.
// Show runs the show action .
func (c *SpaceController) Show(ctx *app.ShowSpaceContext) error {
	id, 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 {
		s, err := appl.Spaces().Load(ctx.Context, id)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, err)
		}
		return ctx.ConditionalEntity(*s, c.config.GetCacheControlSpace, func() error {
			spaceData, err := ConvertSpaceFromModel(ctx.Context, c.db, ctx.RequestData, *s)
			if err != nil {
				return jsonapi.JSONErrorResponse(ctx, err)
			}
			result := app.SpaceSingle{
				Data: spaceData,
			}
			return ctx.OK(&result)
		})
	})
}
func ( c * SpaceController ) Show ( ctx * app . ShowSpaceContext ) error { id , 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 { s , err := appl . Spaces ( ) . Load ( ctx . Context , id ) if err != nil { return jsonapi . JSONErrorResponse ( ctx , err ) } return ctx . ConditionalEntity ( * s , c . config . GetCacheControlSpace , func ( ) error { spaceData , err := ConvertSpaceFromModel ( ctx . Context , c . db , ctx . RequestData , * s ) if err != nil { return jsonapi . JSONErrorResponse ( ctx , err ) } result := app . SpaceSingle { Data : spaceData , } return ctx . OK ( & result ) } ) } ) }
Show runs the show action.
Show runs the show action .