feat: changes global find and update payload api from global to slug as the key to find/update with

This commit is contained in:
Jarrod Flesch
2021-03-22 09:15:55 -04:00
parent 39000bdcb2
commit c71ba2b079
3 changed files with 4 additions and 4 deletions

View File

@@ -275,7 +275,7 @@ The following Global operations are available through the Local API:
```js
// Result will be the Header Global.
const result = await payload.findGlobal({
global: 'header', // required
slug: 'header', // required
depth: 2,
locale: 'en',
fallbackLocale: false,
@@ -290,7 +290,7 @@ const result = await payload.findGlobal({
```js
// Result will be the updated Header Global.
const result = await payload.updateGlobal({
global: 'header', // required
slug: 'header', // required
data: { // required
nav: [
{

View File

@@ -1,6 +1,6 @@
async function findOne(options) {
const {
global: globalSlug,
slug: globalSlug,
depth,
locale = this?.config?.localization?.defaultLocale,
fallbackLocale = null,

View File

@@ -1,6 +1,6 @@
async function update(options) {
const {
global: globalSlug,
slug: globalSlug,
depth,
locale = this?.config?.localization?.defaultLocale,
fallbackLocale = null,