Commit aeb47124 authored by Kim, Subin's avatar Kim, Subin
Browse files

admin User 반복생성 수정 완료

parent dd785351
......@@ -18,20 +18,21 @@ sequelize
})
);
const adminRole = await Role.findOne({ where: { name: "admin" } });
if (!adminRole) {
await User.create({
const adminRole = await Role.findOne({ where: { name: "admin" } })
await User.findOrCreate({
where: { userId: "admin" },
defaults: {
userId: "admin",
name: "관리자",
email: "han35799@naver.com",
nickname: "haha",
birth: "990926",
phoneNumber: "01086074580",
nickname: "admin",
birth: "000000",
phoneNumber: "01000000000",
password: "admin!",
img: "970aaa79673a39331d45d4b55ca05d25",
roleId: adminRole?.id,
}
});
} else { }
app.listen(appConfig.port, () => {
console.log(`Server is running on port ${appConfig.port}`);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment