Backend half

This commit is contained in:
2025-07-11 19:56:28 +02:00
parent fa868e7c1d
commit 8600fa7c1d
19426 changed files with 3750448 additions and 8108 deletions
@@ -0,0 +1,26 @@
import { Request, Response } from 'express';
import { UserQueryDispatcher } from '../../functions/Users/Queries/UserQueryDispatcher';
import { UserCommandDispatcher } from '../../functions/Users/Commands/UserCommandDispatcher';
import { GetAllUsersQuery } from '../../functions/Users/Queries/UserQuery';
export async function getAllUsers(
req: Request,
res: Response,
queryDispatcher: UserQueryDispatcher,
commandDispatcher: UserCommandDispatcher
): Promise<void> {
try {
const query = new GetAllUsersQuery();
const users = await queryDispatcher.dispatch(query);
res.status(200).json({
success: true,
data: users
});
} catch (error: any) {
res.status(500).json({
success: false,
message: error.message || 'Failed to get users'
});
}
}