http method changes and use ServeError

This commit is contained in:
linkability 2023-10-06 22:35:09 +01:00
parent a1b6917831
commit d87583392e
No known key found for this signature in database

View file

@ -124,7 +124,7 @@ module.exports = function(files: Files) {
} }
) )
router.put( router.patch(
"/dfv", "/dfv",
requiresAccount, requiresPermissions("manage"), requiresAccount, requiresPermissions("manage"),
(req, res) => { (req, res) => {
@ -137,9 +137,7 @@ module.exports = function(files: Files) {
res.send(`dfv has been set to ${Account.defaultFileVisibility}`) res.send(`dfv has been set to ${Account.defaultFileVisibility}`)
} else { } else {
res.status(400) ServeError(res, 400, "invalid dfv")
res.send("invalid dfv")
} }
} }
) )
@ -174,7 +172,7 @@ module.exports = function(files: Files) {
} }
) )
router.put("/me/name", router.patch("/me/name",
requiresAccount, requiresAccount,
noAPIAccess, noAPIAccess,
parser, parser,