From 4d4cf9dcabe742d9c23a82e477cc5fe00f31743d Mon Sep 17 00:00:00 2001 From: Matthew Stanciu Date: Wed, 13 May 2020 12:32:47 -0400 Subject: [PATCH] Remove axios yay --- package.json | 1 - pages/api/join.js | 13 ------------- yarn.lock | 21 --------------------- 3 files changed, 35 deletions(-) diff --git a/package.json b/package.json index 1b470145..d0b7661e 100755 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "@next/mdx": "^9.3.6", "@segment/snippet": "^4.9.0", "airtable-plus": "^1.0.4", - "axios": "^0.19.2", "isomorphic-unfetch": "^3.0.0", "lodash": "^4.17.15", "next": "^9.3.6", diff --git a/pages/api/join.js b/pages/api/join.js index 9256d055..69308757 100644 --- a/pages/api/join.js +++ b/pages/api/join.js @@ -1,6 +1,5 @@ import AirtablePlus from 'airtable-plus' import fetch from 'isomorphic-unfetch' -import axios from 'axios' const joinTable = new AirtablePlus({ apiKey: process.env.AIRTABLE_API_KEY, @@ -13,10 +12,6 @@ export default async (req, res) => { res.setHeader('Access-Control-Allow-Headers', "*"); if (req.method === 'POST') { const data = JSON.parse(req.body) - console.log(data) - console.log(`name: ${data.name}`) - console.log(`token: ${process.env.SLACK_BOT_TOKEN}`) - console.log(`AIRTABLE: ${process.env.AIRTABLE_API_KEY}`) const exists = await isDuplicate(data.name, data.email, data.reason) const empty = await isEmpty(data) @@ -29,8 +24,6 @@ export default async (req, res) => { Reason: data.reason }) if (data.teen) { - console.log(data) - let testData = { token: process.env.SLACK_BOT_TOKEN } let postData = { channel: 'G0147KPNHU0', //G0132DNFE7J blocks: [ @@ -83,12 +76,6 @@ export default async (req, res) => { }, body: JSON.stringify(postData) }).catch(err => console.error(err)) - /*axios.post('https://slack.com/api/chat.postMessage', JSON.stringify(postData), { - headers: { - 'Content-Type': 'application/json', - 'Authorization': `Bearer ${process.env.SLACK_BOT_TOKEN}` - }, - }).then(r => console.log(r)).catch(err => console.error(err))*/ } } res.json({ status: 'success' }) diff --git a/yarn.lock b/yarn.lock index 7879434b..9fe1dd25 100755 --- a/yarn.lock +++ b/yarn.lock @@ -1772,13 +1772,6 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e" integrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug== -axios@^0.19.2: - version "0.19.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27" - integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA== - dependencies: - follow-redirects "1.5.10" - babel-code-frame@^6.22.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -2710,13 +2703,6 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -debug@=3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - debug@^2.2.0, debug@^2.3.3: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -3203,13 +3189,6 @@ flush-write-stream@^1.0.0: inherits "^2.0.3" readable-stream "^2.3.6" -follow-redirects@1.5.10: - version "1.5.10" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" - integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ== - dependencies: - debug "=3.1.0" - for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"