From c71ba2b079d109d4028d74f76603905d9382d364 Mon Sep 17 00:00:00 2001 From: Jarrod Flesch Date: Mon, 22 Mar 2021 09:15:55 -0400 Subject: [PATCH] feat: changes global find and update payload api from global to slug as the key to find/update with --- docs/local-api/overview.mdx | 4 ++-- src/globals/operations/local/findOne.ts | 2 +- src/globals/operations/local/update.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/local-api/overview.mdx b/docs/local-api/overview.mdx index b43d48f20b..49e0089481 100644 --- a/docs/local-api/overview.mdx +++ b/docs/local-api/overview.mdx @@ -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: [ { diff --git a/src/globals/operations/local/findOne.ts b/src/globals/operations/local/findOne.ts index 07e848a2f8..aad5724e8e 100644 --- a/src/globals/operations/local/findOne.ts +++ b/src/globals/operations/local/findOne.ts @@ -1,6 +1,6 @@ async function findOne(options) { const { - global: globalSlug, + slug: globalSlug, depth, locale = this?.config?.localization?.defaultLocale, fallbackLocale = null, diff --git a/src/globals/operations/local/update.ts b/src/globals/operations/local/update.ts index b7c9cbd23d..ac3c64ff4b 100644 --- a/src/globals/operations/local/update.ts +++ b/src/globals/operations/local/update.ts @@ -1,6 +1,6 @@ async function update(options) { const { - global: globalSlug, + slug: globalSlug, depth, locale = this?.config?.localization?.defaultLocale, fallbackLocale = null,