mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-01 22:29:44 +08:00
feat: improve admin panel (#14180)
This commit is contained in:
@@ -28,22 +28,9 @@ export class MockTeamWorkspace extends Mocker<
|
||||
},
|
||||
});
|
||||
|
||||
const feature = await this.db.feature.findFirst({
|
||||
where: {
|
||||
name: Feature.TeamPlan,
|
||||
},
|
||||
});
|
||||
|
||||
if (!feature) {
|
||||
throw new Error(
|
||||
`Feature ${Feature.TeamPlan} does not exist in DB. You might forgot to run data-migration first.`
|
||||
);
|
||||
}
|
||||
|
||||
await this.db.workspaceFeature.create({
|
||||
data: {
|
||||
workspaceId: id,
|
||||
featureId: feature.id,
|
||||
reason: 'test',
|
||||
activated: true,
|
||||
name: Feature.TeamPlan,
|
||||
|
||||
@@ -27,23 +27,10 @@ export class MockUser extends Mocker<MockUserInput, MockedUser> {
|
||||
});
|
||||
|
||||
if (feature) {
|
||||
const featureRecord = await this.db.feature.findFirst({
|
||||
where: {
|
||||
name: feature,
|
||||
},
|
||||
});
|
||||
|
||||
if (!featureRecord) {
|
||||
throw new Error(
|
||||
`Feature ${feature} does not exist in DB. You might forgot to run data-migration first.`
|
||||
);
|
||||
}
|
||||
|
||||
const config = FeatureConfigs[feature];
|
||||
await this.db.userFeature.create({
|
||||
data: {
|
||||
userId: user.id,
|
||||
featureId: featureRecord.id,
|
||||
name: feature,
|
||||
type: config.type,
|
||||
reason: 'test',
|
||||
|
||||
Reference in New Issue
Block a user