'use strict';
import { parseJsonBodyFromRequest } from '../../../fd-toolbox/lib/utils.js';
import { apiOkResponse, apiBadRequestResponse, apiNoContentResponse } from '../../meta/server/web/responses.js';
import { responseMessages } from '../../../fd-toolbox/server/web/response-messages.js';
import { getUserVisibleWorkspaces, setVisibleWorkspaces } from '../../fd-app-toolbox/server/workspace/visible-workspaces.js';

var __defProp=Object['defineProperty'],__name=(_0xb1c520,_0x4a7f57)=>__defProp(_0xb1c520,'name',{'value':_0x4a7f57,'configurable':!![]});async function visibleWorkspaceGetRoute(){const _0x465ab3=await getUserVisibleWorkspaces();return apiOkResponse(_0x465ab3);}__name(visibleWorkspaceGetRoute,'visibleWorkspaceGetRoute');async function visibleWorkspacePostRoute(_0x405409){const _0x51cc10=await parseJsonBodyFromRequest(_0x405409);if(!_0x51cc10['visibleWorkspaceIds'])return apiBadRequestResponse(responseMessages['routingError']);return await setVisibleWorkspaces(_0x51cc10['visibleWorkspaceIds']),apiNoContentResponse();}__name(visibleWorkspacePostRoute,'visibleWorkspacePostRoute');

export { visibleWorkspaceGetRoute, visibleWorkspacePostRoute };
