export default async function removeUserFromJob(db, { jobId, userId }) {
  if (!jobId)
    throw new Error("A jobId is required.");
  if (!userId)
    throw new Error("A userId is required.");
  const job = await db.find("jobs", jobId);
  const jobData = {
    userIds: ((job === null || job === void 0 ? void 0 : job.userIds) || []).filter((jobUserId) => jobUserId !== userId),
    updatedAt: new Date(),
  };
  console.log(jobData);
  return db.update("jobs", jobId, jobData);
}
