mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-03 17:02:40 +00:00
pre-filter brews list when finding google brews
This commit is contained in:
@@ -190,7 +190,7 @@ app.get('/user/:username', async (req, res, next)=>{
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(googleBrews && googleBrews.length > 0) {
|
if(googleBrews && googleBrews.length > 0) {
|
||||||
for (const brew of brews) {
|
for (const brew of brews.filter(brew => brew.googleId)) {
|
||||||
const match = googleBrews.findIndex((b)=>b.editId === brew.editId);
|
const match = googleBrews.findIndex((b)=>b.editId === brew.editId);
|
||||||
if(match !== -1) {
|
if(match !== -1) {
|
||||||
brew.googleId = googleBrews[match].googleId;
|
brew.googleId = googleBrews[match].googleId;
|
||||||
|
|||||||
Reference in New Issue
Block a user