|
@@ -83,7 +83,7 @@ export class SysConfigController {
|
|
|
try {
|
|
try {
|
|
|
const { teamId, ...body } = request.body
|
|
const { teamId, ...body } = request.body
|
|
|
const userId = request.user.id
|
|
const userId = request.user.id
|
|
|
- const userRole = request.user.role
|
|
|
|
|
|
|
+ const userRole = request.user.role as UserRole
|
|
|
|
|
|
|
|
const config = await this.sysConfigService.createTeamConfig(body, userId, userRole, teamId)
|
|
const config = await this.sysConfigService.createTeamConfig(body, userId, userRole, teamId)
|
|
|
return reply.code(201).send(config)
|
|
return reply.code(201).send(config)
|
|
@@ -100,7 +100,7 @@ export class SysConfigController {
|
|
|
const { name } = request.params
|
|
const { name } = request.params
|
|
|
const { teamId, ...body } = request.body
|
|
const { teamId, ...body } = request.body
|
|
|
const userId = request.user.id
|
|
const userId = request.user.id
|
|
|
- const userRole = request.user.role
|
|
|
|
|
|
|
+ const userRole = request.user.role as UserRole
|
|
|
|
|
|
|
|
const config = await this.sysConfigService.updateTeamConfig(name, body, userId, userRole, teamId)
|
|
const config = await this.sysConfigService.updateTeamConfig(name, body, userId, userRole, teamId)
|
|
|
return reply.send(config)
|
|
return reply.send(config)
|
|
@@ -117,7 +117,7 @@ export class SysConfigController {
|
|
|
const { name } = request.params
|
|
const { name } = request.params
|
|
|
const { teamId } = request.body
|
|
const { teamId } = request.body
|
|
|
const userId = request.user.id
|
|
const userId = request.user.id
|
|
|
- const userRole = request.user.role
|
|
|
|
|
|
|
+ const userRole = request.user.role as UserRole
|
|
|
|
|
|
|
|
await this.sysConfigService.deleteTeamConfig(name, userId, userRole, teamId)
|
|
await this.sysConfigService.deleteTeamConfig(name, userId, userRole, teamId)
|
|
|
return reply.send({ success: true })
|
|
return reply.send({ success: true })
|
|
@@ -134,7 +134,7 @@ export class SysConfigController {
|
|
|
const { name } = request.params
|
|
const { name } = request.params
|
|
|
const { teamId } = request.query
|
|
const { teamId } = request.query
|
|
|
const userId = request.user.id
|
|
const userId = request.user.id
|
|
|
- const userRole = request.user.role
|
|
|
|
|
|
|
+ const userRole = request.user.role as UserRole
|
|
|
|
|
|
|
|
const config = await this.sysConfigService.getTeamConfig(
|
|
const config = await this.sysConfigService.getTeamConfig(
|
|
|
name,
|
|
name,
|
|
@@ -155,7 +155,7 @@ export class SysConfigController {
|
|
|
try {
|
|
try {
|
|
|
const { teamId, ...query } = request.query
|
|
const { teamId, ...query } = request.query
|
|
|
const userId = request.user.id
|
|
const userId = request.user.id
|
|
|
- const userRole = request.user.role
|
|
|
|
|
|
|
+ const userRole = request.user.role as UserRole
|
|
|
|
|
|
|
|
const configs = await this.sysConfigService.listTeamConfigs(
|
|
const configs = await this.sysConfigService.listTeamConfigs(
|
|
|
query,
|
|
query,
|