Skip to content

Commit

Permalink
feat: changes global find and update payload api from global to slug …
Browse files Browse the repository at this point in the history
…as the key to find/update with
  • Loading branch information
JarrodMFlesch committed Mar 22, 2021
1 parent 39000bd commit c71ba2b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/local-api/overview.mdx
Expand Up @@ -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,
Expand All @@ -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: [
{
Expand Down
2 changes: 1 addition & 1 deletion 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,
Expand Down
2 changes: 1 addition & 1 deletion 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,
Expand Down

0 comments on commit c71ba2b

Please sign in to comment.