fix: update permissions structure for secretary API interactions
This commit is contained in:
@@ -198,7 +198,7 @@ export default function MySecretariesPage() {
|
|||||||
|
|
||||||
const updatePermsMutation = useMutation({
|
const updatePermsMutation = useMutation({
|
||||||
mutationFn: ({ uuid, permissions }: { uuid: string; permissions: SecretaryPermissions }) =>
|
mutationFn: ({ uuid, permissions }: { uuid: string; permissions: SecretaryPermissions }) =>
|
||||||
api.patch(`/api/v1/secretary/${uuid}`, { permissions }),
|
api.patch(`/api/v1/secretary/${uuid}`, { permissions: { version: 1, resources: permissions } }),
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
toast.success('دسترسیها بروزرسانی شد');
|
toast.success('دسترسیها بروزرسانی شد');
|
||||||
setEditTarget(null);
|
setEditTarget(null);
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class DoctorSecretary
|
|||||||
'owner_type' => $this->ownerType,
|
'owner_type' => $this->ownerType,
|
||||||
'clinic_uuid' => $this->clinic?->getUuid(),
|
'clinic_uuid' => $this->clinic?->getUuid(),
|
||||||
'is_active' => $this->active,
|
'is_active' => $this->active,
|
||||||
'permissions' => $this->getPermissions(),
|
'permissions' => $this->getPermissions()['resources'] ?? $this->getPermissions(),
|
||||||
'created_at' => $this->createdAt,
|
'created_at' => $this->createdAt,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user