import { User } from "@models/user";
import isIdNan from "@server/middlewareButNotReally/isIdNan";

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