From 2e4bb83f47bdda5e2320a20fcba2b53a13b73611 Mon Sep 17 00:00:00 2001 From: Joe Karow <58997957+JoeKarow@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:47:28 -0500 Subject: [PATCH] update mock data --- .../ui/mockData/json/orgPhone.forEditDrawer.json | 1 + packages/ui/mockData/json/orgPhone.update.json | 1 + .../mockData/json/orgWebsite.forEditDrawer.json | 1 + packages/ui/mockData/orgPhone.ts | 10 ++++++++-- packages/ui/mockData/orgWebsite.ts | 15 +++++++++++++-- 5 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 packages/ui/mockData/json/orgPhone.forEditDrawer.json create mode 100644 packages/ui/mockData/json/orgPhone.update.json create mode 100644 packages/ui/mockData/json/orgWebsite.forEditDrawer.json diff --git a/packages/ui/mockData/json/orgPhone.forEditDrawer.json b/packages/ui/mockData/json/orgPhone.forEditDrawer.json new file mode 100644 index 0000000000..d5b43f2aa3 --- /dev/null +++ b/packages/ui/mockData/json/orgPhone.forEditDrawer.json @@ -0,0 +1 @@ +{"id":"ophn_01GVH3VEVCFKT3NWQ79STYVDKR","number":"2027457000","ext":null,"primary":true,"published":true,"deleted":false,"countryId":"ctry_01GW2HHDK9M26M80SG63T21SVH","phoneTypeId":null,"description":{"id":"ftxt_01E4ENGMG2G5QN0K9DATJVDJS2","key":"orgn_01GVH3V408N0YS7CDYAH3F2BMH.ophn_01GVH3VEVCFKT3NWQ79STYVDKR.description","text":"Medical Care/ Appointments"},"locationOnly":false,"serviceOnly":true} \ No newline at end of file diff --git a/packages/ui/mockData/json/orgPhone.update.json b/packages/ui/mockData/json/orgPhone.update.json new file mode 100644 index 0000000000..c4711c4185 --- /dev/null +++ b/packages/ui/mockData/json/orgPhone.update.json @@ -0,0 +1 @@ +{"id":"ophn_01GVH3VEVCFKT3NWQ79STYVDKR","legacyId":"5e7e4bdbd54f1760921a4220","legacyDesc":"Medical Care/ Appointments","countryCode":null,"number":"2027457000","ext":null,"primary":true,"published":true,"deleted":false,"migrationReview":true,"countryId":"ctry_01GW2HHDK9M26M80SG63T21SVH","phoneTypeId":null,"descriptionId":"ftxt_01E4ENGMG2G5QN0K9DATJVDJS2","locationOnly":false,"serviceOnly":true,"createdAt":"2020-03-27T18:54:19.650Z","updatedAt":"2024-01-08T20:26:39.630Z"} \ No newline at end of file diff --git a/packages/ui/mockData/json/orgWebsite.forEditDrawer.json b/packages/ui/mockData/json/orgWebsite.forEditDrawer.json new file mode 100644 index 0000000000..00f793775a --- /dev/null +++ b/packages/ui/mockData/json/orgWebsite.forEditDrawer.json @@ -0,0 +1 @@ +{"id":"oweb_01H29ENF953Z14FKACFT01SXDF","url":"https://www.reclaim.care/","descriptionId":null,"isPrimary":false,"deleted":false,"published":true,"organizationId":"orgn_01H29CX1KXN804H47QZAX7TQAZ","orgLocationId":null,"orgLocationOnly":false,"createdAt":"2023-03-26T20:36:25.142Z","updatedAt":"2023-05-13T00:39:43.348Z"} \ No newline at end of file diff --git a/packages/ui/mockData/orgPhone.ts b/packages/ui/mockData/orgPhone.ts index d671a3e4f5..34f7326018 100644 --- a/packages/ui/mockData/orgPhone.ts +++ b/packages/ui/mockData/orgPhone.ts @@ -16,7 +16,10 @@ export const orgPhone = { update: getTRPCMock({ path: ['orgPhone', 'update'], type: 'mutation', - response: (input) => {}, + response: async (input) => { + const { default: data } = await import('./json/orgPhone.update.json') + return { ...data, createdAt: new Date(data.createdAt), updatedAt: new Date(data.updatedAt) } + }, }), forContactInfo: getTRPCMock({ path: ['orgPhone', 'forContactInfo'], @@ -30,6 +33,9 @@ export const orgPhone = { forEditDrawer: getTRPCMock({ path: ['orgPhone', 'forEditDrawer'], type: 'query', - response: orgPhoneData.forEditDrawer, + response: async () => { + const { default: data } = await import(`./json/orgPhone.forEditDrawer.json`) + return data + }, }), } satisfies MockHandlerObject<'orgPhone'> diff --git a/packages/ui/mockData/orgWebsite.ts b/packages/ui/mockData/orgWebsite.ts index 245438879d..c9e7dcab8a 100644 --- a/packages/ui/mockData/orgWebsite.ts +++ b/packages/ui/mockData/orgWebsite.ts @@ -14,11 +14,22 @@ export const orgWebsite = { forEditDrawer: getTRPCMock({ path: ['orgWebsite', 'forEditDrawer'], type: 'query', - response: orgWebsiteData.forEditDrawer, + response: async () => { + const { default: data } = await import('./json/orgWebsite.forEditDrawer.json') + return { + description: undefined, + ...data, + createdAt: new Date(data.createdAt), + updatedAt: new Date(data.updatedAt), + } + }, }), update: getTRPCMock({ path: ['orgWebsite', 'update'], type: 'mutation', - response: (input) => ({ ...orgWebsiteData.forEditDrawer, ...input.data }), + response: async (input) => { + const { default: data } = await import('./json/orgWebsite.forEditDrawer.json') + return { ...data, ...input.data, createdAt: new Date(data.createdAt), updatedAt: new Date(Date.now()) } + }, }), } satisfies MockHandlerObject<'orgWebsite'>