Use default in the model instead of creating it manually

This commit is contained in:
Lee 2022-11-17 11:35:46 +00:00
parent a44ca7d8af
commit 6a81b0c781
No known key found for this signature in database
GPG Key ID: 6EA25896ECCB3121
2 changed files with 16 additions and 11 deletions

View File

@ -13,10 +13,22 @@ const schema = new Schema({
// User Settings
discordEmbed: {
embed: Boolean,
title: String,
description: String,
color: String,
embed: {
type: Boolean,
default: true,
},
title: {
type: String,
default: "{id}.{ext}",
},
description: {
type: String,
default: null,
},
color: {
type: String,
default: "0063EB",
},
},
});

View File

@ -46,13 +46,6 @@ export async function createUser(username, password) {
password: hashPassword(salt, password),
salt: salt,
uploadKey: randomString(16),
discordEmbed: {
embed: true,
title: "{id}.{ext}",
description: null,
color: "0063EB",
},
});
user.save();
} catch (e) {