Formatting.
This commit is contained in:
parent
3f75ebf853
commit
3ad1e9a5b2
|
@ -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.",
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.")
|
||||
}
|
||||
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue