/**
 * GET /api/me/following
 *
 * Returns the IDs of all users the authenticated user follows.
 * Used client-side to filter the Supabase Realtime Presence channel —
 * Realtime has no native server-side filter, so the frontend needs the list.
 *
 * No pagination — follows rarely exceed 1 k for a single user.
 *
 * Response:
 *   { userIds: string[] }
 */
import { requireUser } from "../../utils/auth";
import { getFollowingIds } from "../../db/profile";

export default defineEventHandler(async (event) => {
  const user = await requireUser(event);
  const userIds = await getFollowingIds(user.id);
  return { userIds };
});
