upgrading accesslevels
This commit is contained in:
parent
00eb3ce13a
commit
b5473f29c6
|
@ -1,8 +1,9 @@
|
||||||
const StatusCodes = require("../../utilities/statusCodes")
|
const StatusCodes = require("../../utilities/statusCodes")
|
||||||
|
|
||||||
module.exports = async ctx => {
|
module.exports = async ctx => {
|
||||||
|
const existingAccessLevels = await ctx.instance.authApi.loadAccessLevels()
|
||||||
const accessLevels = ctx.request.body.accessLevels
|
const accessLevels = ctx.request.body.accessLevels
|
||||||
accessLevels.version = 0
|
accessLevels.version = existingAccessLevels.version
|
||||||
await ctx.instance.authApi.saveAccessLevels(accessLevels)
|
await ctx.instance.authApi.saveAccessLevels(accessLevels)
|
||||||
await ctx.instance.templateApi.upgradeData(ctx.request.body.newHierarchy)
|
await ctx.instance.templateApi.upgradeData(ctx.request.body.newHierarchy)
|
||||||
ctx.response.status = StatusCodes.OK
|
ctx.response.status = StatusCodes.OK
|
||||||
|
|
Loading…
Reference in New Issue