feat: changes global find and update payload api from global to slug as the key to find/update with
This commit is contained in:
@@ -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: [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
async function findOne(options) {
|
||||
const {
|
||||
global: globalSlug,
|
||||
slug: globalSlug,
|
||||
depth,
|
||||
locale = this?.config?.localization?.defaultLocale,
|
||||
fallbackLocale = null,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
async function update(options) {
|
||||
const {
|
||||
global: globalSlug,
|
||||
slug: globalSlug,
|
||||
depth,
|
||||
locale = this?.config?.localization?.defaultLocale,
|
||||
fallbackLocale = null,
|
||||
|
||||
Reference in New Issue
Block a user