implement global update

This commit is contained in:
Elliot DeNolf
2020-09-13 08:40:28 -04:00
parent 2b81e887ad
commit f2f8ffbbb2
2 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
async function update(options) {
const {
global: globalSlug,
depth,
locale,
fallbackLocale,
data,
} = options;
const globalConfig = this.globals.config.find((config) => config.slug === globalSlug);
return this.operations.globals.update({
slug: globalSlug,
data,
depth,
globalConfig,
overrideAccess: true,
req: {
payloadAPI: 'local',
locale,
fallbackLocale,
payload: this,
},
});
}
module.exports = update;