Allow optional fields on the _users table

This commit is contained in:
AbegaM
2024-04-23 16:47:08 +03:00
parent dbfee1e793
commit 21423133c0

View File

@@ -92,7 +92,7 @@ const registerUser = async (req, res) => {
}
*/
const { username, password } = req.body.fields;
const { username, password, ...optionalFields } = req.body.fields;
try {
if (!username) {
@@ -156,6 +156,7 @@ const registerUser = async (req, res) => {
salt,
hashed_password: hashedPassword,
is_superuser: 'false',
...optionalFields,
},
});