mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 13:22:14 +00:00
- Scope writable settings to the selected managed record\n- Render typed Guardian controls with separated audit attribution
27 lines
1.2 KiB
TypeScript
27 lines
1.2 KiB
TypeScript
/**
|
|
* Record configuration has its own cache family because it follows the active
|
|
* health record, while `authMe()` remains the person at the keyboard. Keeping
|
|
* the record id in every member prevents an actor cache cell from being read
|
|
* or invalidated as though it belonged to a switched record.
|
|
*/
|
|
export const recordSettingsKeys = {
|
|
root: () => ["record-settings"] as const,
|
|
detail: (recordId: string) =>
|
|
["record-settings", recordId, "detail"] as const,
|
|
integrations: (recordId: string) =>
|
|
["record-settings", recordId, "integrations"] as const,
|
|
profile: (recordId: string) =>
|
|
["record-settings", recordId, "profile"] as const,
|
|
family: (recordId: string, family: string) =>
|
|
["record-settings", recordId, family] as const,
|
|
/** Named aliases stay unambiguous when assembled into `queryKeys`. */
|
|
recordSettingsDetail: (recordId: string) =>
|
|
["record-settings", recordId, "detail"] as const,
|
|
recordSettingsIntegrations: (recordId: string) =>
|
|
["record-settings", recordId, "integrations"] as const,
|
|
recordSettingsProfile: (recordId: string) =>
|
|
["record-settings", recordId, "profile"] as const,
|
|
recordSettingsFamily: (recordId: string, family: string) =>
|
|
["record-settings", recordId, family] as const,
|
|
};
|