import { User } from "~/models/user";

export default eventHandler(async (ev) => {
	const id = parseInt(getRouterParam(ev, "id") as string);
	let dat = await User.find({
		"favs.stories": {
			$in: [id],
		},
	})
		.select("-auth -email -ipLog -password")
		.exec();
	return dat.map((a) => a.toObject());
});
