Skip to content

Production-level concerns#77

Open
skitterm wants to merge 11 commits intomasterfrom
another-branch
Open

Production-level concerns#77
skitterm wants to merge 11 commits intomasterfrom
another-branch

Conversation

@skitterm
Copy link
Copy Markdown
Owner

@skitterm skitterm commented Mar 8, 2024

This PR ensures that all production-specific considerations like CI, security, tier-specific logging, and so forth are addressed.

Comment on lines -35 to -47
public async componentDidMount() {
const id = '6015aa416131eb0a74e89e52'
// get the first user... return that for now
try {
const userResponse = await fetch(`/users/${id}`);
if (userResponse.status !== 200) {
throw new Error(userResponse.statusText);
}
const user = await userResponse.json();
this.setState({ user });
} catch(err) {
console.error('Unable to find user');
}
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't needed for now.

Comment on lines +32 to +44
public async componentDidMount() {
const url = new URL(window.location.href);
const userId = url.searchParams.get("userId");
if (userId) {
const userResponse = await fetch("/users");
const users = (await userResponse.json()) as User[];
const user = users.find((item) => {
return item._id === userId;
});
if (user) {
this.props.onUserSelected(user);
this.props.history.push("/messages");
}
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we load the data at the page-level instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants