pre-filter brews list when finding google brews

This commit is contained in:
Charlie Humphreys committed 2022-05-26 04:45:50 +00:00
1 parent 627c52e845
commit b54b7e317e
1 file changed
+1 -1
+1 -1
View File
@@ -190,7 +190,7 @@ app.get('/user/:username', async (req, res, next)=>{
});
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);
if(match !== -1) {
brew.googleId = googleBrews[match].googleId;