import { createParamDecorator, ExecutionContext } from '@nestjs/common';
import { AdminRequestUser } from '../guards/admin.guard';

export const CurrentAdmin = createParamDecorator((_data: unknown, context: ExecutionContext): AdminRequestUser => {
  const request = context.switchToHttp().getRequest<{ adminUser: AdminRequestUser }>();
  return request.adminUser;
});
