1
0
Fork 0
mirror of synced 2024-06-23 08:30:31 +12:00

Formatting.

This commit is contained in:
mike12345567 2021-05-12 17:43:29 +01:00
parent 3811acbaec
commit 2fa7ee5bcb
4 changed files with 8 additions and 4 deletions

View file

@ -44,6 +44,6 @@ exports.removeLock = async ctx => {
ctx.throw(400, "Unable to remove lock.")
}
ctx.body = {
message: "Lock removed successfully."
message: "Lock removed successfully.",
}
}

View file

@ -13,6 +13,10 @@ if (env.isDev() || env.isTest()) {
.delete("/api/admin/:devPath(.*)", controller.redirectDelete)
}
router.delete("/api/dev/:appId/lock", authorized(BUILDER), controller.removeLock)
router.delete(
"/api/dev/:appId/lock",
authorized(BUILDER),
controller.removeLock
)
module.exports = router

View file

@ -24,7 +24,7 @@ async function checkDevAppLocks(ctx) {
}
// get the user which is currently using the dev app
const userId = getGlobalIDFromUserMetadataID(ctx.user._id)
if (!await doesUserHaveLock(appId, userId)) {
if (!(await doesUserHaveLock(appId, userId))) {
ctx.throw(403, "User does not hold app lock.")
}

View file

@ -7,7 +7,7 @@ let devAppClient
// we init this as we want to keep the connection open all the time
// reduces the performance hit
exports.init = async () => {
devAppClient = await (new Client(DB_NAME)).init()
devAppClient = await new Client(DB_NAME).init()
}
exports.doesUserHaveLock = async (devAppId, userId) => {