Skip to content

Commit

Permalink
docs: Handle network error for nested user in post fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Jul 21, 2024
1 parent 501cb82 commit 8ff2bf9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion website/src/fixtures/posts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,15 @@ export const postFixtures = [
(post as any).author = user;
return user;
})
.catch(e => {})
.catch(e => {
// fallback in case of failure
const user = {
id: post.author,
name: 'Leanne Graham',
};
(post as any).author = user;
return user;
})
: Promise.resolve({}),
),
);
Expand Down

0 comments on commit 8ff2bf9

Please sign in to comment.