import { p as prisma } from "./user--mpkKOwW.js";
async function renewSelectedCalendarCredentialId(selectedCalendarWhereUnique, credentialId) {
  const selectedCalendars = await prisma.selectedCalendar.findMany({
    where: {
      ...selectedCalendarWhereUnique,
      credentialId: null
    }
  });
  if (!selectedCalendars.length)
    return false;
  await prisma.selectedCalendar.updateMany({
    where: {
      id: {
        in: selectedCalendars.map((selectedCalendar) => selectedCalendar.id)
      }
    },
    data: {
      credentialId
    }
  });
  return true;
}
export {
  renewSelectedCalendarCredentialId as r
};
