mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 22:32:41 +00:00
remove unused logic from loadpage
This commit is contained in:
@@ -47,21 +47,19 @@ const ArchivePage = createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
loadPage : async function(page) {
|
loadPage : async function(page) {
|
||||||
if(this.state.title == '') {} else {
|
this.updateUrl();
|
||||||
|
try {
|
||||||
try {
|
//this.updateUrl();
|
||||||
//this.updateUrl();
|
this.setState({ searching: true, error: null });
|
||||||
this.setState({ searching: true, error: null });
|
const title = encodeURIComponent(this.state.title);
|
||||||
const title = encodeURIComponent(this.state.title);
|
await request.get(`/api/archive?title=${title}&page=${page}`)
|
||||||
await request.get(`/api/archive?title=${title}&page=${page}`)
|
.then((response)=>{
|
||||||
.then((response)=>{
|
if(response.ok) {
|
||||||
if(response.ok) {
|
this.updateStateWithBrews(response.body.brews, page, response.body.totalPages);
|
||||||
this.updateStateWithBrews(response.body.brews, page, response.body.totalPages);
|
}
|
||||||
}
|
});
|
||||||
});
|
} catch (error) {
|
||||||
} catch (error) {
|
console.log(`LoadPage error: ${error}`);
|
||||||
console.log(`LoadPage error: ${error}`);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user