Fix APIKey typing (#16541)
Following this https://github.com/twentyhq/twenty/pull/16540 Those were not failing (yet) but were wrongly typed and error prone --------- Co-authored-by: Guillim <guillim@users.noreply.github.com>
This commit is contained in:
+3
-3
@@ -2,9 +2,9 @@ import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { PermissionFlagType } from 'twenty-shared/constants';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { In, Repository } from 'typeorm';
|
||||
import { PermissionFlagType } from 'twenty-shared/constants';
|
||||
|
||||
import { ApiKeyRoleService } from 'src/engine/core-modules/api-key/services/api-key-role.service';
|
||||
import { TOOL_PERMISSION_FLAGS } from 'src/engine/metadata-modules/permissions/constants/tool-permission-flags';
|
||||
@@ -132,8 +132,8 @@ export class PermissionsService {
|
||||
setting: PermissionFlagType;
|
||||
apiKeyId?: string;
|
||||
}): Promise<boolean> {
|
||||
if (apiKeyId) {
|
||||
const roleId = await this.apiKeyRoleService.getRoleIdForApiKey(
|
||||
if (isDefined(apiKeyId)) {
|
||||
const roleId = await this.apiKeyRoleService.getRoleIdForApiKeyId(
|
||||
apiKeyId,
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user