Explorar o código

Add edge case if no parameter is provided

sbkwgh %!s(int64=8) %!d(string=hai) anos
pai
achega
ef0e5bb464
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      routes/user.js

+ 2 - 0
routes/user.js

@@ -334,6 +334,8 @@ router.put('/:username', async (req, res) => {
 				validationErrors.push(Errors.invalidLoginCredentials)
 				throw validationErrors
 			}
+		} else {
+			res.json({})
 		}
 	} catch (e) {
 		if(validationErrors.length) {