'use strict';
import { apiOkResponse, apiCreatedResponse, apiNoContentResponse } from '../../../meta/server/web/responses.js';
import { deleteUser } from '../../users/user-deletions.js';
import { apiNotFoundError } from '../../../../fd-toolbox/server/web/errors.js';
import { responseMessages } from '../../../../fd-toolbox/server/web/response-messages.js';
import { createUserWithSettings, editUser } from '../../users/edit-other-users.js';
import { getUserDto } from '../../users/user-manager.js';
import { parseJsonBodyFromRequest } from '../../../../fd-toolbox/lib/utils.js';

var __defProp=Object['defineProperty'],__name=(_0x466278,_0x392dae)=>__defProp(_0x466278,'name',{'value':_0x392dae,'configurable':!![]});async function otheruserIdGetRoute(_0xe1c942,{params:_0x2e91ee}){const _0x184729=_0x2e91ee['id'],_0x48b72c=await getUserDto(_0x184729);if(!_0x48b72c)throw apiNotFoundError(responseMessages['notFoundError']);return apiOkResponse(_0x48b72c);}__name(otheruserIdGetRoute,'otheruserIdGetRoute');async function otheruserIdPostRoute(_0x3a326a){const _0x1f0776=await parseJsonBodyFromRequest(_0x3a326a);return await createUserWithSettings(_0x1f0776),apiCreatedResponse(_0x1f0776);}__name(otheruserIdPostRoute,'otheruserIdPostRoute');async function otheruserIdPutRoute(_0x58c498,{params:{id:_0x422609}}){const _0x15b0d7=await parseJsonBodyFromRequest(_0x58c498);_0x15b0d7['id']=_0x422609;const _0x2b5371=await editUser(_0x15b0d7);return apiOkResponse(_0x2b5371);}__name(otheruserIdPutRoute,'otheruserIdPutRoute');async function otheruserIdDeleteRoute(_0x4a0f97,{params:_0x240caf}){const _0x5ce95d=_0x240caf['id'];return _0x5ce95d&&await deleteUser(_0x5ce95d),apiNoContentResponse();}__name(otheruserIdDeleteRoute,'otheruserIdDeleteRoute');

export { otheruserIdDeleteRoute, otheruserIdGetRoute, otheruserIdPostRoute, otheruserIdPutRoute };
