"use strict";
const index = require("./orgDomains-W_rFTMBa.cjs");
async function renewSelectedCalendarCredentialId(selectedCalendarWhereUnique, credentialId) {
  const selectedCalendars = await index.prisma.selectedCalendar.findMany({
    where: {
      ...selectedCalendarWhereUnique,
      credentialId: null
    }
  });
  if (!selectedCalendars.length)
    return false;
  await index.prisma.selectedCalendar.updateMany({
    where: {
      id: {
        in: selectedCalendars.map((selectedCalendar) => selectedCalendar.id)
      }
    },
    data: {
      credentialId
    }
  });
  return true;
}
exports.renewSelectedCalendarCredentialId = renewSelectedCalendarCredentialId;
