diff options
| -rw-r--r-- | db/models/users.js | 9 | ||||
| -rw-r--r-- | lib/whitelist.js | 1 | ||||
| -rw-r--r-- | routes/users.js | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/db/models/users.js b/db/models/users.js index d5b1f5b8..48e8c94f 100644 --- a/db/models/users.js +++ b/db/models/users.js @@ -46,6 +46,15 @@ const attributes = { comment: null, field: "confidential" }, + unit: { + type: DataTypes.STRING(255), + allowNull: true, + defaultValue: 'SAT', + primaryKey: false, + autoIncrement: false, + comment: null, + field: "unit" + }, address: { type: DataTypes.STRING(255), allowNull: true, diff --git a/lib/whitelist.js b/lib/whitelist.js index bdba4a95..e5f672b2 100644 --- a/lib/whitelist.js +++ b/lib/whitelist.js @@ -1,5 +1,6 @@ whitelist = [ 'id', +'unit', 'fbtoken', 'username', 'address', diff --git a/routes/users.js b/routes/users.js index 1fa04c6b..4644cc06 100644 --- a/routes/users.js +++ b/routes/users.js @@ -143,6 +143,7 @@ app.post("/user", auth, async (req, res) => { let { user } = req; let { username, + unit, currency, currencies, twofa, @@ -169,6 +170,7 @@ app.post("/user", auth, async (req, res) => { }); } + user.unit = unit; user.currency = currency; user.currencies = currencies; |
