This commit is contained in:
Benjamin Toby
2024-08-22 12:59:50 +01:00
parent 9fe7c765c6
commit c41e94e7eb
2 changed files with 47 additions and 14 deletions
+12 -1
View File
@@ -52,10 +52,18 @@ const localAddUser = require("../engine/user/add-user");
* @param {string} props.key - FULL ACCESS API Key
* @param {string} props.database - Database Name
* @param {UserDataPayload} props.payload - User Data Payload
* @param {string} props.encryptionKey
* @param {string} [props.encryptionSalt]
*
* @returns { Promise<FunctionReturn> }
*/
async function addUser({ key, payload, database }) {
async function addUser({
key,
payload,
database,
encryptionKey,
encryptionSalt,
}) {
/**
* Check for local DB settings
*
@@ -96,6 +104,8 @@ async function addUser({ key, payload, database }) {
return await localAddUser({
dbSchema: dbSchema,
payload: payload,
encryptionKey,
encryptionSalt,
});
}
}
@@ -109,6 +119,7 @@ async function addUser({ key, payload, database }) {
const reqPayload = JSON.stringify({
payload,
database,
encryptionKey,
});
const httpsRequest = (scheme?.match(/^http$/i) ? http : https).request(