fix(api): 🐛 Fix incorrect ancestor order in note context endpoint

This commit is contained in:
Jesse Wierzbinski 2024-05-11 16:44:00 -10:00
parent 4713d0f93f
commit 6859ab5775
No known key found for this signature in database

View file

@ -599,7 +599,9 @@ export class Note {
const viewableAncestors = ancestors.filter((ancestor) => const viewableAncestors = ancestors.filter((ancestor) =>
ancestor.isViewableByUser(fetcher), ancestor.isViewableByUser(fetcher),
); );
return viewableAncestors;
// Reverse the order so that the oldest posts are first
return viewableAncestors.toReversed();
} }
/** /**
@ -625,6 +627,7 @@ export class Note {
const viewableDescendants = descendants.filter((descendant) => const viewableDescendants = descendants.filter((descendant) =>
descendant.isViewableByUser(fetcher), descendant.isViewableByUser(fetcher),
); );
return viewableDescendants; return viewableDescendants;
} }
} }