Use default in the model instead of creating it manually
This commit is contained in:
parent
a44ca7d8af
commit
6a81b0c781
@ -13,10 +13,22 @@ const schema = new Schema({
|
|||||||
|
|
||||||
// User Settings
|
// User Settings
|
||||||
discordEmbed: {
|
discordEmbed: {
|
||||||
embed: Boolean,
|
embed: {
|
||||||
title: String,
|
type: Boolean,
|
||||||
description: String,
|
default: true,
|
||||||
color: String,
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: "{id}.{ext}",
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
color: {
|
||||||
|
type: String,
|
||||||
|
default: "0063EB",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -46,13 +46,6 @@ export async function createUser(username, password) {
|
|||||||
password: hashPassword(salt, password),
|
password: hashPassword(salt, password),
|
||||||
salt: salt,
|
salt: salt,
|
||||||
uploadKey: randomString(16),
|
uploadKey: randomString(16),
|
||||||
|
|
||||||
discordEmbed: {
|
|
||||||
embed: true,
|
|
||||||
title: "{id}.{ext}",
|
|
||||||
description: null,
|
|
||||||
color: "0063EB",
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
user.save();
|
user.save();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Reference in New Issue
Block a user