Minor improvements to Google Books Node

This commit is contained in:
Jan Oberhauser
2020-11-04 16:11:51 +01:00
parent 9a1328ccfb
commit 709dcdd57c
2 changed files with 18 additions and 18 deletions

View File

@@ -26,7 +26,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
body,
qs,
uri: uri || `https://www.googleapis.com/books/${resource}`,
json: true
json: true,
};
try {
if (Object.keys(headers).length !== 0) {
@@ -67,7 +67,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
}
// Try to return the error prettier
throw new Error(
`Google Books error response [${error.statusCode}]: ${errors}`
`Google Books error response [${error.statusCode}]: ${errors}`,
);
}
throw error;
@@ -117,7 +117,7 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa
'typ': 'JWT',
'alg': 'RS256',
},
}
},
);
const options: OptionsWithUri = {
@@ -130,7 +130,7 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa
assertion: signature,
},
uri: 'https://oauth2.googleapis.com/token',
json: true
json: true,
};
//@ts-ignore