Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
6bbca318f6
commit
0db33652eb
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user