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
|
|
@ -91,6 +91,11 @@ where
|
|||
.ok_or_else(move || ServiceError::EntityNotFound(*id))?;
|
||||
Ok(slot)
|
||||
}
|
||||
|
||||
async fn exists(&self, id: Uuid, _context: Self::Context) -> Result<bool, ServiceError> {
|
||||
Ok(self.slot_dao.get_slot(&id).await.map(|s| s.is_some())?)
|
||||
}
|
||||
|
||||
async fn create_slot(&self, slot: &Slot, context: Self::Context) -> Result<Slot, ServiceError> {
|
||||
self.permission_service
|
||||
.check_permission("hr", context.clone())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue