add mocked auth
This commit is contained in:
committed by
Daniel Hutzel
parent
937d9caf2b
commit
49f6b8c060
@@ -89,7 +89,7 @@ const logProcessArgs = () => {
|
||||
const insertQuery = constructInsertQuery(targetEntityName, targetColumns);
|
||||
|
||||
const srcEntityName = camelCaseToSnake(targetEntityName.split(".").pop());
|
||||
const srcResultRows = await srcStorage.read(srcEntityName); // e.g. [ { AlbumId:1, ArtistId:1, Title:'some' }, ... ]
|
||||
let srcResultRows = await srcStorage.read(srcEntityName); // e.g. [ { AlbumId:1, ArtistId:1, Title:'some' }, ... ]
|
||||
if (!srcResultRows || srcResultRows.length < ZERO_VALUE) {
|
||||
console.log(
|
||||
`[LOG] Skipping ${targetEntityName}.
|
||||
@@ -106,6 +106,15 @@ const logProcessArgs = () => {
|
||||
);
|
||||
}
|
||||
|
||||
// for mock auth
|
||||
if (srcEntityName === "Employees" || srcEntityName === "Customers") {
|
||||
columns.push("password");
|
||||
srcResultRows = srcResultRows.map((row) => ({
|
||||
...row,
|
||||
password: "some",
|
||||
}));
|
||||
}
|
||||
|
||||
const transaction = await targetStorage.tx();
|
||||
await transaction.run(
|
||||
srcResultRows.map((row) => insertQuery(Object.values(row), columns))
|
||||
|
||||
Reference in New Issue
Block a user