import pick from "../../helpers/pick";
export default async function findCompany(db, { id }, filterKeys = ["id", "name", "email", "phone", "createdAt", "updatedAt"]) {
  const data = await db.find("companies", id);
  if (!data)
    return null;
  const company = {
    ...data,
    id,
  };
  return filterKeys ? pick(company, filterKeys) : company;
}
