From fc780d4643b112e65938762759bf009bf2b628f5 Mon Sep 17 00:00:00 2001 From: adueck Date: Thu, 28 Nov 2024 01:19:20 +0500 Subject: [PATCH] oops there was an error in the range key --- account/src/routers/submissions-router.ts | 27 ----------------------- functions/lib/spreadsheet-tools.ts | 2 +- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/account/src/routers/submissions-router.ts b/account/src/routers/submissions-router.ts index 010a736..453109f 100644 --- a/account/src/routers/submissions-router.ts +++ b/account/src/routers/submissions-router.ts @@ -16,33 +16,6 @@ function sendResponse(res: Response, payload: T.APIResponse) { const submissionsRouter = express.Router(); -const auth = new google.auth.GoogleAuth({ - // TODO: THESE CREDENTIALS ARE NOT WORKING SOMEHOW !! - credentials: { - private_key: Buffer.from(env.lingdocsServiceAccountKey, "base64").toString( - "ascii" - ), - client_email: env.lingdocsServiceAccountEmail, - }, - scopes: [ - "https://www.googleapis.com/auth/spreadsheets", - "https://www.googleapis.com/auth/drive.file", - ], -}); -const { spreadsheets } = google.sheets({ - version: "v4", - auth, -}); -const sheets: Sheets = { - spreadsheetId: env.lingdocsDictionarySpreadsheet, - spreadsheets, -}; - -submissionsRouter.get("/", async (req, res, next) => { - const r = await getEntriesFromSheet(sheets); - res.send(r); -}); - // Guard all api with authentication submissionsRouter.use((req, res, next) => { if (req.isAuthenticated()) { diff --git a/functions/lib/spreadsheet-tools.ts b/functions/lib/spreadsheet-tools.ts index 740d646..4e171c0 100644 --- a/functions/lib/spreadsheet-tools.ts +++ b/functions/lib/spreadsheet-tools.ts @@ -99,7 +99,7 @@ export async function updateDictionaryEntries( const values = [entryToRowArray(entry)]; return [ { - q: `B${rowNum}:${lastCol}${rowNum}`, + range: `B${rowNum}:${lastCol}${rowNum}`, values, }, ];