|
|
@ -134,12 +134,18 @@ router.post('/write/:task?', feature_upload, (req, res) => {
|
|
|
|
: (task = DataEvent.API_PAGE_WRITE);
|
|
|
|
: (task = DataEvent.API_PAGE_WRITE);
|
|
|
|
if (req.files.length > 0) {
|
|
|
|
if (req.files.length > 0) {
|
|
|
|
var path = req.files[0].path;
|
|
|
|
var path = req.files[0].path;
|
|
|
|
|
|
|
|
//console.log('NEW FEATURE URL', path);
|
|
|
|
feature = '/' + path.substring(7, path.length);
|
|
|
|
feature = '/' + path.substring(7, path.length);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
var url = body.feature_image;
|
|
|
|
var url = body.feature_image;
|
|
|
|
url != null || url != undefined || url != ''
|
|
|
|
//switch this to the new feature path edit
|
|
|
|
? (feature = url.substring(21, url.length))
|
|
|
|
if (url != null || url != undefined || url != '') {
|
|
|
|
: (feature = '');
|
|
|
|
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.feature = feature;
|
|
|
|
body.deleted = false;
|
|
|
|
body.deleted = false;
|
|
|
|