Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 17:31:39 +00:00
co-authored by renee-png
parent 6bbca318f6
commit 0db33652eb
+13
View File
@@ -355,3 +355,16 @@ export async function fetchCaseCustomValues(caseId: string): Promise<Record<stri
});
return map;
}
export async function fetchClientCustomValues(clientId: string): Promise<Record<string, string>> {
const { data } = await supabase
.from("client_field_values")
.select("value, field:custom_client_fields(key)")
.eq("client_id", clientId);
const map: Record<string, string> = {};
(data ?? []).forEach((row: any) => {
const k = row.field?.key;
if (k) map[k] = row.value ?? "";
});
return map;
}