From 2d7477fbdeee76fae1eed003b07d264978a10ce1 Mon Sep 17 00:00:00 2001 From: Adam Rensel Date: Tue, 11 May 2021 11:06:23 -0400 Subject: [PATCH] Fix airtable --- .github/workflows/src/app/airtable.js | 9 ++++++--- .github/workflows/src/index.js | 5 ++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/src/app/airtable.js b/.github/workflows/src/app/airtable.js index 69d56983..717692f6 100644 --- a/.github/workflows/src/app/airtable.js +++ b/.github/workflows/src/app/airtable.js @@ -96,8 +96,8 @@ class ATable { fetchGraduate(githubLogin, table) { const airtable = Airtable.base(GITHUB_GRADUATION); + const data = [] return new Promise((resolve, reject)=>{ - const data = [] airtable(table).select({ // Selecting the first 3 records in Pending Reviews: maxRecords: 1, @@ -109,6 +109,8 @@ class ATable { records.forEach(function(record) { data.push(record.fields) }); + + fetchNextPage() }, function done(err) { if (err) { if(err.error === "NOT_FOUND") { @@ -118,9 +120,10 @@ class ATable { reject(err) return; } + + resolve(data[0]) }); - console.log("ADATA: \n\n" + JSON.stringify(data)) - resolve(data[0]) + }).catch((err)=>{ reject(err) }) diff --git a/.github/workflows/src/index.js b/.github/workflows/src/index.js index ef1ab57b..aa1895f2 100644 --- a/.github/workflows/src/index.js +++ b/.github/workflows/src/index.js @@ -66,8 +66,7 @@ try { const hasSdp = results[2] // Has the user completed the shipping form? (address must exist for the form to be submitted) - const completedShippingForm = user2021?.get("Address Line 1").length > 0 - console.log("2021: \n\n" + user2021) + const completedShippingForm = user2021 && user2021["Address Line 1"].length > 0 const fileNames = pull.files.edges.map((file)=>{ return file.node.path }) @@ -169,7 +168,7 @@ Feel free to re-request a review from me and I'll come back and take a look! } console.log(feedBackMessage) - + return try { await octokit.createReview(` **Hi ${ actionEvent.pullAuthor },** -- knotmirror 0.0.1