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