mirror of
https://github.com/wassname/talk.git
synced 2026-07-04 14:32:24 +08:00
19 lines
463 B
JavaScript
19 lines
463 B
JavaScript
const Asset = {
|
|
comments({id}, _, {loaders}) {
|
|
return loaders.Comments.getByAssetID.load(id);
|
|
},
|
|
settings({settings = null}, _, {loaders}) {
|
|
return loaders.Settings.load()
|
|
.then((globalSettings) => {
|
|
if (settings) {
|
|
settings = Object.assign({}, globalSettings.toObject(), settings);
|
|
} else {
|
|
settings = globalSettings.toObject();
|
|
}
|
|
return settings;
|
|
});
|
|
}
|
|
};
|
|
|
|
module.exports = Asset;
|