Updated ImportJsonTask file mapDocuments method to use unshift instead of push for sorting order (#8183)

This commit is contained in:
Prasad Bandaru
2025-01-03 01:35:50 +05:30
committed by GitHub
parent d6459150fe
commit 9cab404194
+3 -1
View File
@@ -73,7 +73,9 @@ export default class ImportJSONTask extends ImportTask {
) {
Object.values(documents).forEach((node) => {
const id = uuidv4();
output.documents.push({
// Using unshift instead of push to maintain the correct order of documents
// because addDocumentToStructure uses index 0 for insertion, reversing the order
output.documents.unshift({
...node,
path: "",
// populate text to maintain consistency with existing data.