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:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user