Skip to content

Commit

Permalink
update mock data
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeKarow committed Jan 8, 2024
1 parent dccca1f commit 2e4bb83
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/ui/mockData/json/orgPhone.forEditDrawer.json
Original file line number Diff line number Diff line change
@@ -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}
1 change: 1 addition & 0 deletions packages/ui/mockData/json/orgPhone.update.json
Original file line number Diff line number Diff line change
@@ -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"}
1 change: 1 addition & 0 deletions packages/ui/mockData/json/orgWebsite.forEditDrawer.json
Original file line number Diff line number Diff line change
@@ -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"}
10 changes: 8 additions & 2 deletions packages/ui/mockData/orgPhone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export const orgPhone = {
update: getTRPCMock({
path: ['orgPhone', 'update'],
type: 'mutation',
response: (input) => {},
response: async (input) => {

Check warning on line 19 in packages/ui/mockData/orgPhone.ts

View check run for this annotation

InReachBot / Check Code for Errors

packages/ui/mockData/orgPhone.ts#L19

[@typescript-eslint/no-unused-vars] 'input' is defined but never used.
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'],
Expand All @@ -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'>
15 changes: 13 additions & 2 deletions packages/ui/mockData/orgWebsite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'>

0 comments on commit 2e4bb83

Please sign in to comment.