fixed fire button

pull/231/head
Yariv Menachem 2025-01-01 13:37:28 +02:00
parent f726f2e275
commit fc372d6313
1 changed files with 3 additions and 3 deletions

View File

@ -39,17 +39,17 @@ class JobRepository:
result = self.collection.find_one({"id": job_id})
return JobPost(**result)
def update(self, job_data: dict) -> bool:
def update(self, job: JobPost) -> bool:
"""
Updates a JobPost in the database.
Args:
job_data: A dictionary representing the JobPost data.
job: A dictionary representing the JobPost data.
Returns:
True if the update was successful, False otherwise.
"""
result = self.collection.update_one({"id": job_data["id"]}, {"$set": job_data})
result = self.collection.update_one({"id": job.id}, {"$set": job.model_dump(exclude={"date_posted"})})
return result.modified_count > 0
def insert_job(self, job: JobPost):