import { p as prisma } from "./index-Cw1zbw54.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
};
