Move archive to Whoosh and add search

This commit is contained in:
2019-10-12 05:32:17 +00:00
parent 45b75b420b
commit 7cb87b59fe
14 changed files with 328 additions and 63 deletions

View File

@@ -15,20 +15,20 @@ class Article extends React.Component {
};
}
componentDidMount() {
componentDidMount() {
const id = this.props.match.params.id;
fetch('/api/' + id)
.then(res => res.json())
.then(
(result) => {
this.setState({ story: result.story });
localStorage.setItem(id, JSON.stringify(result.story));
},
(error) => {
this.setState({ error: true });
}
);
fetch('/api/' + id)
.then(res => res.json())
.then(
(result) => {
this.setState({ story: result.story });
localStorage.setItem(id, JSON.stringify(result.story));
},
(error) => {
this.setState({ error: true });
}
);
}
render() {