mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-28 17:52:38 +00:00
limit to 2000
This commit is contained in:
@@ -45,7 +45,7 @@ const ArchivePage = createClass({
|
||||
.catch((err) => this.setState({ error: err }))
|
||||
.finally(() => this.setState({ searching: false }));
|
||||
},
|
||||
updateUrl: function(query) {
|
||||
updateUrl: function() {
|
||||
const url = new URL(window.location.href);
|
||||
const urlParams = new URLSearchParams(url.search);
|
||||
// Clear existing parameters
|
||||
@@ -88,7 +88,12 @@ const ArchivePage = createClass({
|
||||
type='text'
|
||||
value={this.state.title}
|
||||
onChange={this.handleChange}
|
||||
onKeyDown={(e) => e.key === 'Enter' && this.lookup()}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
this.handleChange(e);
|
||||
this.lookup();
|
||||
}
|
||||
}}
|
||||
placeholder='v3 Reference Document'
|
||||
/>
|
||||
{/* In the future, we should be able to filter the results by adding tags.
|
||||
@@ -96,7 +101,7 @@ const ArchivePage = createClass({
|
||||
<input type="checkbox" id="v3" /><label>v3 only</label>
|
||||
*/}
|
||||
|
||||
<button onClick={this.lookup}>
|
||||
<button onClick={() => { this.handleChange({ target: { value: this.state.title } }); this.lookup(); }}>
|
||||
<i
|
||||
className={cx('fas', {
|
||||
'fa-search': !this.state.searching,
|
||||
|
||||
@@ -7,7 +7,7 @@ const archive = {
|
||||
/* Searches for matching title, also attempts to partial match */
|
||||
findBrews: async (req, res, next) => {
|
||||
try {
|
||||
const limit = 3000;
|
||||
const limit = 2000;
|
||||
const brews = await HomebrewModel.find({
|
||||
title: { $regex: req.params.query, $options: 'i' },
|
||||
published: true
|
||||
|
||||
Reference in New Issue
Block a user