From 3677cf688d0e456c42068b4eab0086e64407d938 Mon Sep 17 00:00:00 2001 From: Jacob Fletcher Date: Mon, 5 Jun 2023 17:22:57 -0400 Subject: [PATCH 1/2] fix: flattens relationships in the update operation for globals #2766 (#2776) --- src/globals/operations/update.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/globals/operations/update.ts b/src/globals/operations/update.ts index c139bbf32f..f0f2c737c2 100644 --- a/src/globals/operations/update.ts +++ b/src/globals/operations/update.ts @@ -94,7 +94,7 @@ async function update( } const originalDoc = await afterRead({ - depth, + depth: 0, doc: globalJSON, entityConfig: globalConfig, req, From e30871a96ff25f12401a3cc3bc5e12c064eeff3f Mon Sep 17 00:00:00 2001 From: Dan Ribbens Date: Mon, 5 Jun 2023 17:26:08 -0400 Subject: [PATCH 2/2] fix: #2767 bulk operations missing locales in admin requests --- .../collections/List/SelectionProvider/index.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/admin/components/views/collections/List/SelectionProvider/index.tsx b/src/admin/components/views/collections/List/SelectionProvider/index.tsx index 07ee8e63b4..e78fa670b1 100644 --- a/src/admin/components/views/collections/List/SelectionProvider/index.tsx +++ b/src/admin/components/views/collections/List/SelectionProvider/index.tsx @@ -1,14 +1,8 @@ -import React, { - createContext, - useCallback, - useContext, - useEffect, - useRef, - useState, -} from 'react'; +import React, { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react'; import { useHistory } from 'react-router-dom'; import queryString from 'qs'; import { Where } from '../../../../../../types'; +import { useLocale } from '../../../../utilities/Locale'; export enum SelectAllStatus { AllAvailable = 'allAvailable', @@ -38,6 +32,7 @@ export const SelectionProvider: React.FC = ({ children, docs = [], totalD const contextRef = useRef({} as SelectionContext); const history = useHistory(); + const locale = useLocale(); const [selected, setSelected] = useState({}); const [selectAll, setSelectAll] = useState(SelectAllStatus.None); const [count, setCount] = useState(0); @@ -98,8 +93,9 @@ export const SelectionProvider: React.FC = ({ children, docs = [], totalD } return queryString.stringify({ where, + locale, }, { addQueryPrefix: true }); - }, [history.location.search, selectAll, selected]); + }, [history.location.search, selectAll, selected, locale]); useEffect(() => { if (selectAll === SelectAllStatus.AllAvailable) {