diff --git a/packages/server/src/api/controllers/dev.js b/packages/server/src/api/controllers/dev.js index 3f1a6a11cd..ab1d1490f6 100644 --- a/packages/server/src/api/controllers/dev.js +++ b/packages/server/src/api/controllers/dev.js @@ -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.", } } diff --git a/packages/server/src/api/routes/dev.js b/packages/server/src/api/routes/dev.js index c6203cc221..6513cafeb2 100644 --- a/packages/server/src/api/routes/dev.js +++ b/packages/server/src/api/routes/dev.js @@ -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 diff --git a/packages/server/src/middleware/authorized.js b/packages/server/src/middleware/authorized.js index 29a1bd026b..f3b170dc1c 100644 --- a/packages/server/src/middleware/authorized.js +++ b/packages/server/src/middleware/authorized.js @@ -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.") } diff --git a/packages/server/src/utilities/redis.js b/packages/server/src/utilities/redis.js index 4df61f33fb..cc5444ce3c 100644 --- a/packages/server/src/utilities/redis.js +++ b/packages/server/src/utilities/redis.js @@ -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) => {