0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-02 06:22:43 +00:00

more heroku debug

This commit is contained in:
David Bolack
2024-03-06 13:35:08 -06:00
parent 317b80bf4d
commit 1dc73a951e

View File

@@ -86,16 +86,12 @@ const api = {
return userThemes; return userThemes;
} }
console.log(`Looking for Theme Brews for ${username} that aren't ${id}`);
const brews = await HomebrewModel.getByUser(username, true, fields, { tags: { $in: ['theme', 'Theme'] }, editId: { $ne: id } }) //lean() converts results to JSObjects const brews = await HomebrewModel.getByUser(username, true, fields, { tags: { $in: ['theme', 'Theme'] }, editId: { $ne: id } }) //lean() converts results to JSObjects
.catch((error)=>{throw 'Can not find brews';}); .catch((error)=>{throw 'Can not find brews';});
console.log(brews);
for await (const brew of brews) { for await (const brew of brews) {
const foo = api.getBrew('themes', req=req, res=res, next=next); const foo = api.getBrew('themes', req=req, res=res, next=next);
const brewTheme = req.brew; const brewTheme = req.brew;
console.log(req);
console.log(foo);
if(brewTheme) { if(brewTheme) {
splitTextStyleAndMetadata(brewTheme); splitTextStyleAndMetadata(brewTheme);
userThemes.Brew[`#${brew.editId}`] = { userThemes.Brew[`#${brew.editId}`] = {
@@ -108,8 +104,6 @@ const api = {
}; };
} }
}; };
console.log('We found themes!');
console.log(userThemes);
return userThemes; return userThemes;
}, },
getBrew : (accessType, stubOnly = false)=>{ getBrew : (accessType, stubOnly = false)=>{
@@ -167,10 +161,8 @@ const api = {
const userID = req?.account?.username && (accessType === 'edit') ? req.account.username : stub.authors[0]; const userID = req?.account?.username && (accessType === 'edit') ? req.account.username : stub.authors[0];
console.log('Preparing to load user themes.');
// Clean up brew: fill in missing fields with defaults / fix old invalid values // Clean up brew: fill in missing fields with defaults / fix old invalid values
const userThemes = accessType != 'themes' ? await api.getUsersBrewThemes(userID, id, req, res, next) : ''; const userThemes = accessType != 'themes' ? await api.getUsersBrewThemes(userID, id, req, res, next) : '';
console.log('Made it past userThemes');
if(stub) { if(stub) {
stub.tags = stub.tags || undefined; // Clear empty strings stub.tags = stub.tags || undefined; // Clear empty strings
stub.renderer = stub.renderer || undefined; // Clear empty strings stub.renderer = stub.renderer || undefined; // Clear empty strings