🐛 fix entity missing an id (replace .insert with new Entity().save)

This commit is contained in:
Flam3rboy
2021-09-02 21:31:44 +02:00
parent 7eb20464af
commit 11af8531cc
6 changed files with 25 additions and 23 deletions
+2 -3
View File
@@ -181,7 +181,7 @@ router.post(
// appearently discord doesn't save the date of birth and just calculate if nsfw is allowed
// if nsfw_allowed is null/undefined it'll require date_of_birth to set it to true/false
const user = {
const user = await new User({
created_at: new Date(),
username: adjusted_username,
discriminator,
@@ -207,8 +207,7 @@ router.post(
},
settings: defaultSettings,
fingerprints: []
};
await User.insert(user);
}).save();
return res.json({ token: await generateToken(user.id) });
}