mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-02 08:32:41 +00:00
lint
This commit is contained in:
@@ -255,9 +255,10 @@ const MetadataEditor = createClass({
|
|||||||
default={this.props.metadata.lang || ''}
|
default={this.props.metadata.lang || ''}
|
||||||
placeholder='en'
|
placeholder='en'
|
||||||
onSelect={(value)=>this.handleLanguage(value)}
|
onSelect={(value)=>this.handleLanguage(value)}
|
||||||
onEntry={(e)=> { e.target.setCustomValidity(''); //Clear the validation popup while typing
|
onEntry={(e)=>{
|
||||||
debouncedHandleFieldChange('lang', e);
|
e.target.setCustomValidity(''); //Clear the validation popup while typing
|
||||||
}}
|
debouncedHandleFieldChange('lang', e);
|
||||||
|
}}
|
||||||
options={listLanguages()}
|
options={listLanguages()}
|
||||||
autoSuggest={{
|
autoSuggest={{
|
||||||
suggestMethod : 'startsWith',
|
suggestMethod : 'startsWith',
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const disconnect = async ()=>{
|
|||||||
|
|
||||||
const connect = async (config)=>{
|
const connect = async (config)=>{
|
||||||
return await Mongoose.connect(getMongoDBURL(config), { retryWrites: false })
|
return await Mongoose.connect(getMongoDBURL(config), { retryWrites: false })
|
||||||
.catch(error=>handleConnectionError(error));
|
.catch((error)=>handleConnectionError(error));
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ HomebrewSchema.statics.increaseView = async function(query) {
|
|||||||
|
|
||||||
HomebrewSchema.statics.get = async function(query, fields=null){
|
HomebrewSchema.statics.get = async function(query, fields=null){
|
||||||
const brew = await Homebrew.findOne(query, fields).orFail()
|
const brew = await Homebrew.findOne(query, fields).orFail()
|
||||||
.catch(error=>{throw 'Can not find brew'});
|
.catch((error)=>{throw 'Can not find brew';});
|
||||||
if(!_.isNil(brew.textBin)) { // Uncompress zipped text field
|
if(!_.isNil(brew.textBin)) { // Uncompress zipped text field
|
||||||
unzipped = zlib.inflateRawSync(brew.textBin);
|
unzipped = zlib.inflateRawSync(brew.textBin);
|
||||||
brew.text = unzipped.toString();
|
brew.text = unzipped.toString();
|
||||||
@@ -56,7 +56,7 @@ HomebrewSchema.statics.getByUser = async function(username, allowAccess=false, f
|
|||||||
delete query.published;
|
delete query.published;
|
||||||
}
|
}
|
||||||
const brews = await Homebrew.find(query, fields).lean().exec() //lean() converts results to JSObjects
|
const brews = await Homebrew.find(query, fields).lean().exec() //lean() converts results to JSObjects
|
||||||
.catch(error=>{throw 'Can not find brews'});
|
.catch((error)=>{throw 'Can not find brews';});
|
||||||
return brews;
|
return brews;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user