func (c *AreaController) ShowChildren(ctx *app.ShowChildrenAreaContext) 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 {
		parentArea, err := appl.Areas().Load(ctx, id)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, err)
		}
		children, err := appl.Areas().ListChildren(ctx, parentArea)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, err)
		}
		return ctx.ConditionalEntities(children, c.config.GetCacheControlAreas, func() error {
			res := &app.AreaList{}
			res.Data = ConvertAreas(appl, ctx.RequestData, children, addResolvedPath)
			return ctx.OK(res)
		})
	})
}
// ShowChildren runs the show-children action
ShowChildren runs the show-children action
// ShowChildren runs the show - children action
func (c *AreaController) ShowChildren(ctx *app.ShowChildrenAreaContext) 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 {
		parentArea, err := appl.Areas().Load(ctx, id)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, err)
		}
		children, err := appl.Areas().ListChildren(ctx, parentArea)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, err)
		}
		return ctx.ConditionalEntities(children, c.config.GetCacheControlAreas, func() error {
			res := &app.AreaList{}
			res.Data = ConvertAreas(appl, ctx.RequestData, children, addResolvedPath)
			return ctx.OK(res)
		})
	})
}
func ( c * AreaController ) ShowChildren ( ctx * app . ShowChildrenAreaContext ) 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 { parentArea , err := appl . Areas ( ) . Load ( ctx , id ) if err != nil { return jsonapi . JSONErrorResponse ( ctx , err ) } children , err := appl . Areas ( ) . ListChildren ( ctx , parentArea ) if err != nil { return jsonapi . JSONErrorResponse ( ctx , err ) } return ctx . ConditionalEntities ( children , c . config . GetCacheControlAreas , func ( ) error { res := & app . AreaList { } res . Data = ConvertAreas ( appl , ctx . RequestData , children , addResolvedPath ) return ctx . OK ( res ) } ) } ) }
ShowChildren runs the show-children action
ShowChildren runs the show - children action