Skip to content

Commit da02858

Browse files
committed
feat: allow donor/patient to access appointments
1 parent 0022027 commit da02858

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/hospitals/appointments.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ pub fn get_appointments(
142142
Role::Specialist => {
143143
query = query.filter(specialist_id.eq(user_ctx.id));
144144
}
145+
Role::Donor | Role::Patient => {
146+
query = query.filter(user_id.eq(user_ctx.id));
147+
}
145148
Role::Admin => {}
146-
_ => return Err(AppError::Unauthorized("Access denied".into())),
147149
}
148150

149151
// 🔍 Filters

0 commit comments

Comments
 (0)