Add: allow saveUsercss to build style
This commit is contained in:
parent
3daff40acf
commit
cb23f89b6a
|
@ -290,7 +290,14 @@ function filterUsercss(req) {
|
||||||
|
|
||||||
function saveUsercss(style) {
|
function saveUsercss(style) {
|
||||||
// This function use `saveStyle`, however the response is different.
|
// This function use `saveStyle`, however the response is different.
|
||||||
return saveStyle(style)
|
return Promise.resolve()
|
||||||
|
.then(() => {
|
||||||
|
if (!style.name || !style.namespace) {
|
||||||
|
return Object.assign(usercss.buildMeta(style.source), style);
|
||||||
|
}
|
||||||
|
return style;
|
||||||
|
})
|
||||||
|
.then(saveStyle)
|
||||||
.then(result => ({
|
.then(result => ({
|
||||||
status: 'success',
|
status: 'success',
|
||||||
style: result
|
style: result
|
||||||
|
|
Loading…
Reference in New Issue
Block a user