From 92a516994986b6834b9b8e0810faef0141b6bfb9 Mon Sep 17 00:00:00 2001 From: Ro Date: Sat, 5 Sep 2020 09:58:28 -0700 Subject: [PATCH] fix for saving uploaded image url in pages, type tweak for dashboard --- brain/api/v1/pages.js | 12 +++++++++--- src/styles/main/_typography.styl | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/brain/api/v1/pages.js b/brain/api/v1/pages.js index f74a689..ce37dad 100644 --- a/brain/api/v1/pages.js +++ b/brain/api/v1/pages.js @@ -134,12 +134,18 @@ router.post('/write/:task?', feature_upload, (req, res) => { : (task = DataEvent.API_PAGE_WRITE); if (req.files.length > 0) { var path = req.files[0].path; + //console.log('NEW FEATURE URL', path); feature = '/' + path.substring(7, path.length); } else { var url = body.feature_image; - url != null || url != undefined || url != '' - ? (feature = url.substring(21, url.length)) - : (feature = ''); + //switch this to the new feature path edit + if (url != null || url != undefined || url != '') { + let chunks = url.split('/'); + let strip = chunks[0] + '/' + chunks[1] + chunks[2]; + feature = url.substr(strip.length + 1, url.length); + } else { + feature = ''; + } } body.feature = feature; body.deleted = false; diff --git a/src/styles/main/_typography.styl b/src/styles/main/_typography.styl index d06b037..444889f 100644 --- a/src/styles/main/_typography.styl +++ b/src/styles/main/_typography.styl @@ -100,7 +100,7 @@ url('fonts/Apercu-Mono.svg?#Apercu') format('svg') $baseType = Helvetica, Arial, sans-serif; -$monoType = 'Andale Mono' +$monoType = monospace, courier h1, h2, h3 color $white