mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 02:41:50 +03:00
3459f38c09
no issue - async code was not handled
18 lines
374 B
JavaScript
18 lines
374 B
JavaScript
const serialize = require('./serialize');
|
|
const Promise = require('bluebird');
|
|
|
|
module.exports = (event, model) => {
|
|
const payload = {};
|
|
|
|
if (model) {
|
|
return serialize(event, model)
|
|
.then((result) => {
|
|
Object.assign(payload, result);
|
|
|
|
return payload;
|
|
});
|
|
}
|
|
|
|
return Promise.resolve(payload);
|
|
};
|