Formatting.
This commit is contained in:
parent
0a4c4f1cc0
commit
4b786f51d2
|
@ -21,7 +21,7 @@ function retryConnection() {
|
|||
*/
|
||||
function init() {
|
||||
function errorOccurred(err) {
|
||||
CONNECTED = false;
|
||||
CONNECTED = false
|
||||
console.error("Redis connection failed - " + err)
|
||||
setTimeout(() => {
|
||||
init()
|
||||
|
|
|
@ -7,10 +7,14 @@ const Joi = require("joi")
|
|||
const router = Router()
|
||||
|
||||
function buildAdminInitValidation() {
|
||||
return joiValidator.body(Joi.object({
|
||||
email: Joi.string().required(),
|
||||
password: Joi.string().required(),
|
||||
}).required().unknown(false))
|
||||
return joiValidator.body(
|
||||
Joi.object({
|
||||
email: Joi.string().required(),
|
||||
password: Joi.string().required(),
|
||||
})
|
||||
.required()
|
||||
.unknown(false)
|
||||
)
|
||||
}
|
||||
|
||||
function buildUserSaveValidation(isSelf = false) {
|
||||
|
@ -81,7 +85,11 @@ router
|
|||
buildInviteAcceptValidation(),
|
||||
controller.inviteAccept
|
||||
)
|
||||
.post("/api/admin/users/init", buildAdminInitValidation(), controller.adminUser)
|
||||
.post(
|
||||
"/api/admin/users/init",
|
||||
buildAdminInitValidation(),
|
||||
controller.adminUser
|
||||
)
|
||||
.get("/api/admin/users/self", controller.getSelf)
|
||||
// admin endpoint but needs to come at end (blocks other endpoints otherwise)
|
||||
.get("/api/admin/users/:id", adminOnly, controller.find)
|
||||
|
|
Loading…
Reference in New Issue