feat: improve query performence (#6764)

This commit is contained in:
darkskygit
2024-05-06 09:12:04 +00:00
parent 1303a6a8b4
commit 13f40f435d
12 changed files with 146 additions and 168 deletions
@@ -29,11 +29,7 @@ class WorkspaceResolverMock {
permissions: {
create: {
type: Permission.Owner,
user: {
connect: {
id: user.id,
},
},
userId: user.id,
accepted: true,
},
},
@@ -163,7 +159,7 @@ test('should be able to set workspace feature', async t => {
const f1 = await feature.getWorkspaceFeatures(w1.id);
t.is(f1.length, 0, 'should be empty');
await feature.addWorkspaceFeature(w1.id, FeatureType.Copilot, 1, 'test');
await feature.addWorkspaceFeature(w1.id, FeatureType.Copilot, 'test');
const f2 = await feature.getWorkspaceFeatures(w1.id);
t.is(f2.length, 1, 'should have 1 feature');
@@ -178,7 +174,7 @@ test('should be able to check workspace feature', async t => {
const f1 = await management.hasWorkspaceFeature(w1.id, FeatureType.Copilot);
t.false(f1, 'should not have copilot');
await management.addWorkspaceFeatures(w1.id, FeatureType.Copilot, 1, 'test');
await management.addWorkspaceFeatures(w1.id, FeatureType.Copilot, 'test');
const f2 = await management.hasWorkspaceFeature(w1.id, FeatureType.Copilot);
t.true(f2, 'should have copilot');
@@ -195,7 +191,7 @@ test('should be able revert workspace feature', async t => {
const f1 = await management.hasWorkspaceFeature(w1.id, FeatureType.Copilot);
t.false(f1, 'should not have feature');
await management.addWorkspaceFeatures(w1.id, FeatureType.Copilot, 1, 'test');
await management.addWorkspaceFeatures(w1.id, FeatureType.Copilot, 'test');
const f2 = await management.hasWorkspaceFeature(w1.id, FeatureType.Copilot);
t.true(f2, 'should have feature');