feat: improve admin panel (#14180)

This commit is contained in:
DarkSky
2025-12-30 05:22:54 +08:00
committed by GitHub
parent d6b380aee5
commit 95a5e941e7
94 changed files with 3146 additions and 1114 deletions
@@ -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',