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
|
```js
|
||||||
// Result will be the Header Global.
|
// Result will be the Header Global.
|
||||||
const result = await payload.findGlobal({
|
const result = await payload.findGlobal({
|
||||||
global: 'header', // required
|
slug: 'header', // required
|
||||||
depth: 2,
|
depth: 2,
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
fallbackLocale: false,
|
fallbackLocale: false,
|
||||||
@@ -290,7 +290,7 @@ const result = await payload.findGlobal({
|
|||||||
```js
|
```js
|
||||||
// Result will be the updated Header Global.
|
// Result will be the updated Header Global.
|
||||||
const result = await payload.updateGlobal({
|
const result = await payload.updateGlobal({
|
||||||
global: 'header', // required
|
slug: 'header', // required
|
||||||
data: { // required
|
data: { // required
|
||||||
nav: [
|
nav: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
async function findOne(options) {
|
async function findOne(options) {
|
||||||
const {
|
const {
|
||||||
global: globalSlug,
|
slug: globalSlug,
|
||||||
depth,
|
depth,
|
||||||
locale = this?.config?.localization?.defaultLocale,
|
locale = this?.config?.localization?.defaultLocale,
|
||||||
fallbackLocale = null,
|
fallbackLocale = null,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
async function update(options) {
|
async function update(options) {
|
||||||
const {
|
const {
|
||||||
global: globalSlug,
|
slug: globalSlug,
|
||||||
depth,
|
depth,
|
||||||
locale = this?.config?.localization?.defaultLocale,
|
locale = this?.config?.localization?.defaultLocale,
|
||||||
fallbackLocale = null,
|
fallbackLocale = null,
|
||||||
|
|||||||
Reference in New Issue
Block a user