mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 14:16:12 +00:00
fix(body-sites): skip the site suggestions read without the visits section
A delegate who may keep the illness journal but not read the visits would be refused by GET /api/body-sites on every open of the condition form, and each refusal writes an access-denied row. The field now asks only when the grant covers the visits' section, and the condition page shows the site as text rather than a link in that case. Refs #1025
This commit is contained in:
1 parent
14f0fc4d4f
commit
645032ec97
4 files changed
+41
-7
No files matched your search
@@ -22,6 +22,7 @@ import { PageHeader } from "@/components/ui/page-header";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { useTranslations, useFormatters } from "@/lib/i18n/context";
|
||||
import { bodySiteText } from "@/components/encounters/encounter-labels";
|
||||
import { canReadBodySites } from "@/hooks/use-body-sites";
|
||||
|
||||
import { IllnessCorrelationCard } from "./illness-correlation-card";
|
||||
import { IllnessDayTimeline } from "./illness-day-timeline";
|
||||
@@ -46,7 +47,7 @@ export function IllnessEpisodeDetail({ episodeId }: { episodeId: string }) {
|
||||
const { canManageDomain, sections } = useRecordCapabilities();
|
||||
// The body-site view is read in the visits' section; a grant without it
|
||||
// gets the site as text rather than a link that would be refused.
|
||||
const canOpenBodySites = sections === null || sections.includes("profile");
|
||||
const canOpenBodySites = canReadBodySites(sections);
|
||||
const canManageIllness = canManageDomain("illness");
|
||||
const fmt = useFormatters();
|
||||
const {
|
||||
|
||||
Reference in new issue
Block a user