files null check
This commit is contained in:
parent
c44fb4ebfa
commit
a29f280af1
@ -90,6 +90,8 @@ class UserEndpoint extends ApiEndpoint {
|
|||||||
|
|
||||||
async uploadAvatar (req: Request, res: Response): Promise<void> {
|
async uploadAvatar (req: Request, res: Response): Promise<void> {
|
||||||
const { user, files } = req;
|
const { user, files } = req;
|
||||||
|
if (!files)
|
||||||
|
return void res.status(400).send('Missing file');
|
||||||
const { file } = files;
|
const { file } = files;
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
|
Loading…
Reference in New Issue
Block a user