From 4f4b5435e2198b03a534c00cfd5f896251b6be00 Mon Sep 17 00:00:00 2001 From: Spencer Flagg Date: Wed, 22 Dec 2021 16:02:20 +0100 Subject: [PATCH] on load of flights, write user to airtable --- components/TheSideBar.vue | 2 +- login/index.js | 1 + package.json | 2 +- pages/flights.vue | 18 ++++++++++++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/components/TheSideBar.vue b/components/TheSideBar.vue index 1ca4801..30ee85f 100644 --- a/components/TheSideBar.vue +++ b/components/TheSideBar.vue @@ -299,7 +299,7 @@ diff --git a/login/index.js b/login/index.js index ddd8137..2c4b4bb 100644 --- a/login/index.js +++ b/login/index.js @@ -269,6 +269,7 @@ app.post("/verify", formParser, (req, res) => { ${stylesheet} `); + }); }); diff --git a/package.json b/package.json index 8b87387..9d3481f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flylocal", - "version": "5.0.4.1", + "version": "5.0.4.2", "private": true, "scripts": { "dev": "nuxt", diff --git a/pages/flights.vue b/pages/flights.vue index eca52b0..2058b61 100644 --- a/pages/flights.vue +++ b/pages/flights.vue @@ -382,6 +382,24 @@ export default { this.$segment.identify(emailCookie, { email: emailCookie }); + const newUser = + { + fields: { + Email: emailCookie, + CreatedDate: new Date(), + Type: 'portier-login', + Site: 'https://iflylocal.com/' + } + } + + const res = await fetch(`https://api.airtable.com/v0/appiQwfVZixRgRICe/User/`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer keyJ2ht64ZSN57AG1' + }, + body: JSON.stringify(newUser) + }) } }, created () {