2
0

feat(integration): ️ Improve feedback on GSheets errors

This commit is contained in:
Baptiste Arnaud
2022-03-04 14:40:13 +01:00
parent 9b8f153579
commit d13ca0fa9a
6 changed files with 45 additions and 16 deletions

View File

@ -17,6 +17,8 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
if (req.method === 'GET') {
const credentialsId = req.query.credentialsId.toString()
const auth = await getAuthenticatedGoogleClient(user.id, credentialsId)
if (!auth)
return res.status(404).send("Couldn't find credentials in database")
const response = await drive({
version: 'v3',
auth,