From f1db5728af28858a87f2d328de5d9dcb61423d16 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Wed, 11 Sep 2024 05:16:54 +0200 Subject: [PATCH] Allow posts from [deleted] users to be fetched. --- src/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app.js b/src/app.js index be27039..4b47106 100644 --- a/src/app.js +++ b/src/app.js @@ -73,6 +73,10 @@ function getPosts(postIds) { return {post, acc, user: acc.users[post.author.name]} } + if(post.author.name === '[deleted]') { + return {post, acc, user: {name: '[deleted]'}}; + } + return reddit.getUser(post.author.name).fetch().then(curateUser).then(saveProfileDetails).then(user => ({post, acc, user})); }).then(({post, acc, user}) => { post.user = user;