From b5473f29c6db92349c0fd86f0b95dfd7e6194824 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Fri, 27 Mar 2020 15:14:50 +0000 Subject: [PATCH] upgrading accesslevels --- packages/server/middleware/routeHandlers/upgradeData.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/middleware/routeHandlers/upgradeData.js b/packages/server/middleware/routeHandlers/upgradeData.js index 6093ee9109..24026ace66 100644 --- a/packages/server/middleware/routeHandlers/upgradeData.js +++ b/packages/server/middleware/routeHandlers/upgradeData.js @@ -1,8 +1,9 @@ const StatusCodes = require("../../utilities/statusCodes") module.exports = async ctx => { + const existingAccessLevels = await ctx.instance.authApi.loadAccessLevels() const accessLevels = ctx.request.body.accessLevels - accessLevels.version = 0 + accessLevels.version = existingAccessLevels.version await ctx.instance.authApi.saveAccessLevels(accessLevels) await ctx.instance.templateApi.upgradeData(ctx.request.body.newHierarchy) ctx.response.status = StatusCodes.OK