1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 18:19:25 +00:00

Added new lookup capability inside test data object

This commit is contained in:
2022-02-24 23:06:21 +00:00
parent 5875d7bf1b
commit d6d314ad3b

View File

@@ -356,6 +356,21 @@ async function insertData(dbOptions) {
10); 10);
} }
if (record?.lookups) {
delete dataToInsert.lookups;
for (let [ key, index ] of
Object.entries(record.lookups)) {
const resolveTable = key.split('Id')[0];
index--;
dataToInsert[key] =
data[resolveTable][index][key];
}
}
data[table][counter] = dataToInsert; data[table][counter] = dataToInsert;
const qs = '?, '.repeat(Object.keys( const qs = '?, '.repeat(Object.keys(