From ebf439c5987a8e7480df6af81bc33907832c0b6b Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Tue, 25 Oct 2022 10:27:43 -0700 Subject: [PATCH] fix auth, add pg extension (#1596) --- components/forms/EventDataForm.js | 2 +- db/postgresql/migrations/04_add_uuid/migration.sql | 2 ++ lib/auth.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/forms/EventDataForm.js b/components/forms/EventDataForm.js index db8e7fbb..e236aa3d 100644 --- a/components/forms/EventDataForm.js +++ b/components/forms/EventDataForm.js @@ -22,7 +22,7 @@ export const filterOptions = [ { label: 'Count', value: 'count' }, { label: 'Average', value: 'avg' }, { label: 'Minimum', value: 'min' }, - { label: 'Maxmimum', value: 'max' }, + { label: 'Maximum', value: 'max' }, { label: 'Sum', value: 'sum' }, ]; diff --git a/db/postgresql/migrations/04_add_uuid/migration.sql b/db/postgresql/migrations/04_add_uuid/migration.sql index 21d4cf07..749cef6b 100644 --- a/db/postgresql/migrations/04_add_uuid/migration.sql +++ b/db/postgresql/migrations/04_add_uuid/migration.sql @@ -1,3 +1,5 @@ +-- CreateExtension +CREATE EXTENSION IF NOT EXISTS pgcrypto; -- AlterTable ALTER TABLE "account" ADD COLUMN "account_uuid" UUID NULL; diff --git a/lib/auth.js b/lib/auth.js index 446d5169..a1620845 100644 --- a/lib/auth.js +++ b/lib/auth.js @@ -49,7 +49,7 @@ export async function allowQuery(req) { } if (userId) { - const website = await getWebsite({ id }); + const website = await getWebsite({ websiteUuid: id }); return website && website.userId === userId; }