mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-30 10:36:35 +02:00
Tools: Create test user with flag
This commit is contained in:
parent
43943299f3
commit
385b50d6ce
@ -1,6 +1,7 @@
|
||||
import { DbConnection, dropTables, migrateLatest } from '../db';
|
||||
import newModelFactory from '../models/factory';
|
||||
import { AccountType } from '../models/UserModel';
|
||||
import { UserFlagType } from '../services/database/types';
|
||||
import { Config } from '../utils/types';
|
||||
|
||||
export async function handleDebugCommands(argv: any, db: DbConnection, config: Config): Promise<boolean> {
|
||||
@ -51,4 +52,13 @@ export async function createTestUsers(db: DbConnection, config: Config) {
|
||||
await models.subscription().handlePayment(subscription.stripe_subscription_id, false);
|
||||
}
|
||||
|
||||
{
|
||||
const user = await models.user().save({
|
||||
email: 'userwithflags@example.com',
|
||||
password,
|
||||
full_name: 'User Withflags',
|
||||
});
|
||||
|
||||
await models.userFlag().add(user.id, UserFlagType.AccountOverLimit);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user