From fc13216313b38c7da6cb4aa860cffada528735be Mon Sep 17 00:00:00 2001 From: Colin Williams Date: Tue, 14 Mar 2023 16:20:03 -0700 Subject: [PATCH] Updated member field types to match what was coming back from the server. --- README.md | 4 +++- lib/src/member.ts | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 7c97713..4098451 100644 --- a/README.md +++ b/README.md @@ -36,4 +36,6 @@ The available commands are: * build: `npm run build` * launch: `npm run launch` -Build simply builds the test project, while launch both builds and runs it. If you've made changes to lib, be sure to build there first. \ No newline at end of file +Build simply builds the test project, while launch both builds and runs it. If you've made changes to lib, be sure to build there first. + +Before launching, you should setup environment variables. `sample.env` shows you what variables are necessary. Copy the contents to a new file, `.env`, in the same folder and populate it appropriately. \ No newline at end of file diff --git a/lib/src/member.ts b/lib/src/member.ts index f5caa39..fb620f3 100644 --- a/lib/src/member.ts +++ b/lib/src/member.ts @@ -8,22 +8,22 @@ export interface CustomField { id: number; type: CustomFieldType; label: string; - value_string: string | undefined; - value: string | undefined; + value_string: string | null; + value: string | null; } export interface EmergencyContact { - name: string; - relation: string; - phone: string; - alt_phone: string; + name: string | null; + relation: string | null; + phone: string | null; + alt_phone: string | null; } export interface MemberStatus { id: number; type: string; value: string; - label: MemberStatusLabel | undefined; + label: MemberStatusLabel | null; } export interface MemberStatusLabel { @@ -33,17 +33,17 @@ export interface MemberStatusLabel { export interface Member { address: string; - custom_fields: CustomField[]; - email?: string; - emergency_contacts: EmergencyContact; - group_ids?: number[]; + custom_fields?: CustomField[]; + email: string | null; + emergency_contacts: EmergencyContact[]; + group_ids: number[] | null; homephone: string; id: number; - mobilephone?: string; + mobilephone: string; name: string; - notes: string; + notes: string | null; position: string; - ref?: string; + ref: string; status: MemberStatus; workphone: string; } \ No newline at end of file