fix: address final widget review findings
This commit is contained in:
1 parent
44b55a401c
commit
c09ed96978
8 files changed
+149
-37
No files matched your search
@@ -65,17 +65,20 @@ export const rssFeedRouter = createTRPCRouter({
|
||||
});
|
||||
}
|
||||
|
||||
return settled
|
||||
.flatMap((result) => {
|
||||
if (result.status === "fulfilled") return result.value.data.entries;
|
||||
return [];
|
||||
})
|
||||
.toSorted((entryA, entryB) => {
|
||||
return entryA.published && entryB.published
|
||||
? new Date(entryB.published).getTime() - new Date(entryA.published).getTime()
|
||||
: 0;
|
||||
})
|
||||
.slice(0, input.maximumAmountPosts);
|
||||
return {
|
||||
entries: settled
|
||||
.flatMap((result) => {
|
||||
if (result.status === "fulfilled") return result.value.data.entries;
|
||||
return [];
|
||||
})
|
||||
.toSorted((entryA, entryB) => {
|
||||
return entryA.published && entryB.published
|
||||
? new Date(entryB.published).getTime() - new Date(entryA.published).getTime()
|
||||
: 0;
|
||||
})
|
||||
.slice(0, input.maximumAmountPosts),
|
||||
failedFeedCount: failures.length,
|
||||
};
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user