Add id check for booking
It now checks if sales_person_id and slot_id actually exists.
This commit is contained in:
parent
418a2944f7
commit
bc8a534353
10 changed files with 201 additions and 24 deletions
|
|
@ -86,6 +86,14 @@ where
|
|||
.ok_or(ServiceError::EntityNotFound(id))
|
||||
}
|
||||
|
||||
async fn exists(&self, id: Uuid, _context: Self::Context) -> Result<bool, ServiceError> {
|
||||
Ok(self
|
||||
.sales_person_dao
|
||||
.find_by_id(id)
|
||||
.await
|
||||
.map(|x| x.is_some())?)
|
||||
}
|
||||
|
||||
async fn create(
|
||||
&self,
|
||||
sales_person: &SalesPerson,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue