From 737de91bbc73ccf149681929af30ec486a203473 Mon Sep 17 00:00:00 2001 From: Patrick Toal Date: Mon, 20 May 2024 21:53:09 -0400 Subject: [PATCH] Update naming --- .env.production | 2 + src/boot/appwrite.ts | 51 +++-- .../scheduling/IntervalTemplateComponent.vue | 7 +- .../boat/BoatScheduleTableComponent.vue | 3 +- src/pages/schedule/ManageCalendar.vue | 28 ++- src/stores/auth.ts | 2 +- src/stores/reservation.ts | 4 +- src/stores/schedule.ts | 178 +++++++----------- src/stores/schedule.types.ts | 5 + src/utils/misc.ts | 2 + src/utils/schedule.ts | 71 +++++++ 11 files changed, 201 insertions(+), 152 deletions(-) create mode 100644 .env.production create mode 100644 src/utils/schedule.ts diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..52bb7a7 --- /dev/null +++ b/.env.production @@ -0,0 +1,2 @@ +APPWRITE_API_ENDPOINT='https://appwrite.oys.undock.ca/v1' +APPWRITE_API_PROJECT='bab' diff --git a/src/boot/appwrite.ts b/src/boot/appwrite.ts index ac8feae..ea03ab5 100644 --- a/src/boot/appwrite.ts +++ b/src/boot/appwrite.ts @@ -17,20 +17,45 @@ if (process.env.APPWRITE_API_ENDPOINT && process.env.APPWRITE_API_PROJECT) client .setEndpoint(process.env.APPWRITE_API_ENDPOINT) .setProject(process.env.APPWRITE_API_PROJECT); - +else if (process.env.DEV) { + client + .setEndpoint('http://localhost:4000/api/v1') + .setProject('65ede55a213134f2b688'); +} else { + client.setEndpoint('https://appwrite.oys.undock.ca/v1').setProject('bab'); +} //TODO move this to config file -const AppwriteIds = { - databaseId: '65ee1cbf9c2493faf15f', - collection: { - boat: '66341910003e287cd71c', - reservation: '663f8847000b8f5e29bb', - skillTags: '66072582a74d94a4bd01', - task: '65ee1cd5b550023fae4f', - taskTags: '65ee21d72d5c8007c34c', - timeBlock: '66361869002883fb4c4b', - timeBlockTemplate: '66361f480007fdd639af', - }, -}; +const AppwriteIds = process.env.DEV + ? { + databaseId: '65ee1cbf9c2493faf15f', + collection: { + boat: '66341910003e287cd71c', + reservation: '663f8847000b8f5e29bb', + skillTags: '66072582a74d94a4bd01', + task: '65ee1cd5b550023fae4f', + taskTags: '65ee21d72d5c8007c34c', + interval: '66361869002883fb4c4b', + intervalTemplate: '66361f480007fdd639af', + }, + function: { + userinfo: 'userinfo', + }, + } + : { + databaseId: 'bab_prod', + collection: { + boat: 'boat', + reservation: 'reservation', + skillTags: 'skillTags', + task: 'task', + taskTags: 'taskTags', + interval: 'interval', + intervalTemplate: 'intervalTemplate', + }, + function: { + userinfo: '664038294b5473ef0c8d', + }, + }; const account = new Account(client); const databases = new Databases(client); diff --git a/src/components/scheduling/IntervalTemplateComponent.vue b/src/components/scheduling/IntervalTemplateComponent.vue index 48889ff..4ceab50 100644 --- a/src/components/scheduling/IntervalTemplateComponent.vue +++ b/src/components/scheduling/IntervalTemplateComponent.vue @@ -113,12 +113,9 @@