1
0
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:
Laurent Cozic 2021-08-22 15:50:59 +01:00
parent 43943299f3
commit 385b50d6ce

View File

@ -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);
}
}