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) {
|
||||
// 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 => ({
|
||||
status: 'success',
|
||||
style: result
|
||||
|
|
Loading…
Reference in New Issue
Block a user