import { wrapError } from '../../../lib/errors' ; import { createLicensedRouteHandler } from '../../lib' ; import type { InternalRouteDeps } from './' ; export function initGetActiveSpaceApi ( deps ) { const { internalRouter , getSpacesService } = deps ; internalRouter . get ( { path : '/internal/spaces/_active_space' , validate : false , } , createLicensedRouteHandler ( async ( context , request , response ) => { try { const space = await getSpacesService ( ) . getActiveSpace ( request ) ; return response . ok ( { body : space } ) ; } catch ( error ) { return response . customError ( wrapError ( error ) ) ; } } ) ) ; }