Temp fix for typescript warning
This commit is contained in:
parent
b7866e1339
commit
fc24dbde62
|
@ -87,7 +87,7 @@ imagesRouter.get('/', async (req, res) => {
|
|||
});
|
||||
|
||||
// Image upload
|
||||
imagesRouter.post('/', async (req, res) => {
|
||||
imagesRouter.post('/', async (req:any, res) => {
|
||||
if (req.files === undefined) {
|
||||
res.status(400).json({ status: 'error', error: 'File missing.' });
|
||||
} else if (Array.isArray(req.files.file)) {
|
||||
|
|
|
@ -42,13 +42,13 @@ export const registerFileInFolder = async () => {
|
|||
try {
|
||||
insertImageIntoDB(file.filename, file.stat.mtime.getTime());
|
||||
newCount += 1;
|
||||
} catch (e) { logger.error(`${e.name}: ${e.message}`); }
|
||||
} catch (e: any) { logger.error(`${e.name}: ${e.message}`); }
|
||||
});
|
||||
|
||||
logger.info(
|
||||
`Found ${filesWithStats.length} files, ${filteredFilesWithStats.length} valid images, ${newCount} new`,
|
||||
);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
logger.error(`Error while registering files ${e.message}`);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -72,7 +72,7 @@ export const getThumbnail = async (
|
|||
);
|
||||
imagebuffer = await readFilePromise(`${tmpDir.name}/temp.png`);
|
||||
await unlinkFilePromise(`${tmpDir.name}/temp.png`);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
logger.error(`${e.name}:${e.message}`);
|
||||
}
|
||||
tmpDir.removeCallback();
|
||||
|
|
|
@ -15,7 +15,7 @@ export const validateCredentials = async (
|
|||
try {
|
||||
return (await bcrypt.compare(password, db.getMeta('password')))
|
||||
&& username === db.getMeta('username');
|
||||
} catch (e) {
|
||||
} catch (e:any) {
|
||||
logger.error(`validateCredentials: ${e.message}`);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ function App(props: WithWidth) {
|
|||
await userService.updateCredentials(oldPassword, username, password);
|
||||
handleLogout();
|
||||
setNotification(t('Please login with your new credentials'));
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
if (e.response.status === 401) {
|
||||
setNotification(t('Check your old password and try again'));
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ export const doLogin = async (
|
|||
},
|
||||
);
|
||||
return status;
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.error(e);
|
||||
return e.response.status || 500;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ export const doRegister = async (
|
|||
},
|
||||
);
|
||||
return status;
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
console.error(e);
|
||||
return e.response.status || 500;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue