mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 05:07:22 +01:00
20 lines
484 B
JavaScript
20 lines
484 B
JavaScript
import mongoose from 'mongoose';
|
|
|
|
import { wrap as wrapUser } from '../../common/script/index';
|
|
import { model as User } from '../../website/src/models/user';
|
|
import { TodoSchema } from '../../website/src/models/task';
|
|
|
|
export function generateUser (options = {}) {
|
|
let user = new User(options).toObject();
|
|
|
|
wrapUser(user);
|
|
|
|
return user;
|
|
}
|
|
|
|
export function generateTodo (options = {}) {
|
|
let Todo = mongoose.model('Todo', TodoSchema);
|
|
|
|
return new Todo(options).toObject();
|
|
}
|