mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
fix: add missing awaits (#1472)
* refactor: silence expected console.error call * fix: add missing access service awaits * fix: add missing constraint validation await
This commit is contained in:
parent
1da38781d5
commit
9f7d878422
@ -181,7 +181,7 @@ export class AccessStore implements IAccessStore {
|
||||
environment: permission.environment,
|
||||
};
|
||||
});
|
||||
this.db.batchInsert(T.ROLE_PERMISSION, rows);
|
||||
await this.db.batchInsert(T.ROLE_PERMISSION, rows);
|
||||
}
|
||||
|
||||
async unlinkUserRoles(userId: number): Promise<void> {
|
||||
|
@ -2,6 +2,14 @@ import knex from 'knex';
|
||||
import EventStore from './event-store';
|
||||
import getLogger from '../../test/fixtures/no-logger';
|
||||
|
||||
beforeAll(() => {
|
||||
getLogger.setMuteError(true);
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
getLogger.setMuteError(false);
|
||||
});
|
||||
|
||||
test('Trying to get events if db fails should yield empty list', async () => {
|
||||
const db = knex({
|
||||
client: 'pg',
|
||||
|
@ -406,7 +406,7 @@ export class AccessService {
|
||||
const rolePermissions = role.permissions;
|
||||
const newRole = await this.roleStore.create(baseRole);
|
||||
if (rolePermissions) {
|
||||
this.store.addEnvironmentPermissionsToRole(
|
||||
await this.store.addEnvironmentPermissionsToRole(
|
||||
newRole.id,
|
||||
rolePermissions,
|
||||
);
|
||||
@ -425,8 +425,8 @@ export class AccessService {
|
||||
const rolePermissions = role.permissions;
|
||||
const newRole = await this.roleStore.update(baseRole);
|
||||
if (rolePermissions) {
|
||||
this.store.wipePermissionsFromRole(newRole.id);
|
||||
this.store.addEnvironmentPermissionsToRole(
|
||||
await this.store.wipePermissionsFromRole(newRole.id);
|
||||
await this.store.addEnvironmentPermissionsToRole(
|
||||
newRole.id,
|
||||
rolePermissions,
|
||||
);
|
||||
|
@ -197,7 +197,7 @@ class FeatureToggleService {
|
||||
}
|
||||
|
||||
if (oneOf(DATE_OPERATORS, operator)) {
|
||||
validateDate(constraint.value);
|
||||
await validateDate(constraint.value);
|
||||
}
|
||||
|
||||
if (
|
||||
|
Loading…
Reference in New Issue
Block a user