0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-10 04:52:40 +00:00

Update homebrew.api.js

This commit is contained in:
Trevor Buckner
2024-10-11 23:41:54 -04:00
committed by GitHub
parent dfe26280d2
commit 9037cf1750

View File

@@ -9,6 +9,7 @@ const yaml = require('js-yaml');
const asyncHandler = require('express-async-handler'); const asyncHandler = require('express-async-handler');
const { nanoid } = require('nanoid'); const { nanoid } = require('nanoid');
const { splitTextStyleAndMetadata } = require('../shared/helpers.js'); const { splitTextStyleAndMetadata } = require('../shared/helpers.js');
const { DEFAULT_BREW, DEFAULT_BREW_LOAD } = require('./brewDefaults.js'); const { DEFAULT_BREW, DEFAULT_BREW_LOAD } = require('./brewDefaults.js');
const Themes = require('../themes/themes.json'); const Themes = require('../themes/themes.json');
@@ -266,6 +267,7 @@ const api = {
getThemeBundle : async(req, res)=>{ getThemeBundle : async(req, res)=>{
/* getThemeBundle: Collects the theme and all parent themes /* getThemeBundle: Collects the theme and all parent themes
returns an object containing an array of css, and an array of snippets, in render order 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.id : The shareId ( User theme ) or name ( static theme )
req.params.renderer : The Markdown renderer used for this theme */ req.params.renderer : The Markdown renderer used for this theme */
@@ -392,6 +394,7 @@ const api = {
// Call and wait for afterSave to complete // Call and wait for afterSave to complete
const after = await afterSave(); const after = await afterSave();
if(!after) return; if(!after) return;
res.status(200).send(saved); res.status(200).send(saved);
}, },
deleteGoogleBrew : async (account, id, editId, res)=>{ deleteGoogleBrew : async (account, id, editId, res)=>{