Formatting.
This commit is contained in:
parent
3811acbaec
commit
2fa7ee5bcb
|
@ -44,6 +44,6 @@ exports.removeLock = async ctx => {
|
||||||
ctx.throw(400, "Unable to remove lock.")
|
ctx.throw(400, "Unable to remove lock.")
|
||||||
}
|
}
|
||||||
ctx.body = {
|
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)
|
.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
|
module.exports = router
|
||||||
|
|
|
@ -24,7 +24,7 @@ async function checkDevAppLocks(ctx) {
|
||||||
}
|
}
|
||||||
// get the user which is currently using the dev app
|
// get the user which is currently using the dev app
|
||||||
const userId = getGlobalIDFromUserMetadataID(ctx.user._id)
|
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.")
|
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
|
// we init this as we want to keep the connection open all the time
|
||||||
// reduces the performance hit
|
// reduces the performance hit
|
||||||
exports.init = async () => {
|
exports.init = async () => {
|
||||||
devAppClient = await (new Client(DB_NAME)).init()
|
devAppClient = await new Client(DB_NAME).init()
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.doesUserHaveLock = async (devAppId, userId) => {
|
exports.doesUserHaveLock = async (devAppId, userId) => {
|
||||||
|
|
Loading…
Reference in New Issue