mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-04 00:28:33 +00:00
feat: improve admin panel (#14180)
This commit is contained in:
@@ -113,13 +113,6 @@ export async function createRandomUser(): Promise<{
|
||||
password: '123456',
|
||||
};
|
||||
const result = await runPrisma(async client => {
|
||||
const featureId = await client.feature
|
||||
.findFirst({
|
||||
where: { name: 'free_plan_v1' },
|
||||
select: { id: true },
|
||||
})
|
||||
.then(f => f!.id);
|
||||
|
||||
await client.user.create({
|
||||
data: {
|
||||
...user,
|
||||
@@ -129,7 +122,6 @@ export async function createRandomUser(): Promise<{
|
||||
create: {
|
||||
reason: 'created by test case',
|
||||
activated: true,
|
||||
featureId,
|
||||
name: 'free_plan_v1',
|
||||
type: 1,
|
||||
},
|
||||
@@ -189,19 +181,6 @@ export async function createRandomAIUser(): Promise<{
|
||||
password: '123456',
|
||||
};
|
||||
const result = await runPrisma(async client => {
|
||||
const freeFeatureId = await client.feature
|
||||
.findFirst({
|
||||
where: { name: 'free_plan_v1' },
|
||||
select: { id: true },
|
||||
})
|
||||
.then(f => f!.id);
|
||||
const aiFeatureId = await client.feature
|
||||
.findFirst({
|
||||
where: { name: 'unlimited_copilot' },
|
||||
select: { id: true },
|
||||
})
|
||||
.then(f => f!.id);
|
||||
|
||||
await client.user.create({
|
||||
data: {
|
||||
...user,
|
||||
@@ -212,14 +191,12 @@ export async function createRandomAIUser(): Promise<{
|
||||
{
|
||||
reason: 'created by test case',
|
||||
activated: true,
|
||||
featureId: freeFeatureId,
|
||||
name: 'free_plan_v1',
|
||||
type: 1,
|
||||
},
|
||||
{
|
||||
reason: 'created by test case',
|
||||
activated: true,
|
||||
featureId: aiFeatureId,
|
||||
name: 'unlimited_copilot',
|
||||
type: 0,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user