mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-08 08:53:51 +00:00
refactor: use strict typing
This commit is contained in:
@@ -25,10 +25,11 @@ export async function requestConnection(
|
||||
res: Response<{ verification_url: string; user_code: string } | ErrorResponse>,
|
||||
) {
|
||||
const { sheetId } = req.params;
|
||||
const file = req.file.path;
|
||||
// the check for the file is done in the validation middleware
|
||||
const filePath = (req.file as Express.Multer.File).path;
|
||||
|
||||
try {
|
||||
const client = readFileSync(file, 'utf-8');
|
||||
const client = readFileSync(filePath, 'utf-8');
|
||||
const clientSecret = handleClientSecret(client);
|
||||
const { verification_url, user_code } = await handleInitialConnection(clientSecret, sheetId);
|
||||
|
||||
@@ -40,7 +41,7 @@ export async function requestConnection(
|
||||
|
||||
// delete uploaded file after parsing
|
||||
try {
|
||||
deleteFile(file);
|
||||
await deleteFile(filePath);
|
||||
} catch (_error) {
|
||||
/** we dont handle failure here */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user