create-warlock
Advanced tools
Comparing version 2.7.2 to 2.7.3
{ | ||
"name": "create-warlock", | ||
"version": "2.7.2", | ||
"version": "2.7.3", | ||
"main": "./esm/index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -33,7 +33,7 @@ { | ||
"@mongez/supportive-is": "^2.0.4", | ||
"@warlock.js/auth": "2.7.2", | ||
"@warlock.js/cache": "2.7.2", | ||
"@warlock.js/cascade": "2.7.2", | ||
"@warlock.js/core": "2.7.2", | ||
"@warlock.js/logger": "2.7.2", | ||
"@warlock.js/auth": "2.7.3", | ||
"@warlock.js/cache": "2.7.3", | ||
"@warlock.js/cascade": "2.7.3", | ||
"@warlock.js/core": "2.7.3", | ||
"@warlock.js/logger": "2.7.3", | ||
"@faker-js/faker": "^9.2.0", | ||
@@ -40,0 +40,0 @@ "dayjs": "^1.11.13" |
// this file is called before any main file in the other modules | ||
// This will be called directly when the app starts | ||
import { onceConnected } from "@warlock.js/cascade"; | ||
import { Post } from "./posts/models"; | ||
import { User } from "./users/models/user"; | ||
@@ -13,32 +11,3 @@ // This function will be called once the app is connected to the database | ||
onceConnected(async () => { | ||
const user = await User.findOrCreate( | ||
{ | ||
email: "hassanzohdy@gmail.com", | ||
}, | ||
{ | ||
name: "Hasan Zohdy", | ||
email: "hassanzohdy@gmail.com", | ||
password: "123456", | ||
}, | ||
); | ||
await Post.create({ | ||
author: user, | ||
title: "My first post", | ||
content: "This is my first post", | ||
}); | ||
await Post.create({ | ||
author: user, | ||
title: "My second post", | ||
content: "This is my second post", | ||
}); | ||
await Post.create({ | ||
author: user, | ||
title: "My third post", | ||
content: "This is my third post", | ||
}); | ||
console.log("Done"); | ||
// | ||
}); |
107418
2069