Formatting.

This commit is contained in:
mike12345567 2021-05-12 17:43:29 +01:00
parent 3f75ebf853
commit 3ad1e9a5b2
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) => {