0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Do not fetch user themes if there is no user.

This commit is contained in:
Trevor Buckner
2024-07-31 16:53:34 -04:00
parent 1c1d331df9
commit 1abced20d6

View File

@@ -46,6 +46,9 @@ const api = {
},
//Get array of any of this user's brews tagged with `meta:theme`
getUsersBrewThemes : async (username)=>{
if(!username)
return {};
const fields = [
'title',
'tags',
@@ -251,16 +254,12 @@ const api = {
res.status(200).send(saved);
},
getThemeBundle : async(req, res)=>{
/*
getThemeBundle: Collects the theme and all parent themes
returns an object containing an array of css, in render order, and an array
of snippets ( currently empty )
Important parameter members:
req.params.id: This is the shareId ( User theme ) or name ( static theme )
loaded first.
req.params.renderer: This is the Markdown+ version for the static theme. If a
User theme the value will come from the User Theme metadata.
*/
/* getThemeBundle: Collects the theme and all parent themes
returns an object containing an array of css, and an array of snippets, in render order
req.params.id : The shareId ( User theme ) or name ( static theme )
req.params.renderer : The Markdown renderer used for this theme */
req.params.renderer = _.upperFirst(req.params.renderer);
let currentTheme;
const completeStyles = [];