import { getUserSessions } from '@/modules/admin/services/admin-users.service';
import type { AppContext } from '@/types/hono';

type UserSessionsParams = { id: string };

export async function getUserSessionsHandler(c: AppContext) {
  const { id } = c.req.valid('param' as never) as UserSessionsParams;

  const sessions = await getUserSessions(id);

  return c.json(sessions);
}
