diff --git a/superset-frontend/src/views/CRUD/utils.tsx b/superset-frontend/src/views/CRUD/utils.tsx index c2ae0d8cbed1..7947354484d6 100644 --- a/superset-frontend/src/views/CRUD/utils.tsx +++ b/superset-frontend/src/views/CRUD/utils.tsx @@ -163,20 +163,17 @@ export const getEditedObjects = (userId: string | number) => { export const getUserOwnedObjects = ( userId: string | number, resource: string, -) => { - const filters = { - created: [ - { - col: 'created_by', - opr: 'rel_o_m', - value: `${userId}`, - }, - ], - }; - return SupersetClient.get({ - endpoint: `/api/v1/${resource}/?q=${getParams(filters.created)}`, + filters: Array = [ + { + col: 'created_by', + opr: 'rel_o_m', + value: `${userId}`, + }, + ], +) => + SupersetClient.get({ + endpoint: `/api/v1/${resource}/?q=${getParams(filters)}`, }).then(res => res.json?.result); -}; export const getRecentAcitivtyObjs = ( userId: string | number, diff --git a/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx b/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx index cd42ae621079..a035045318a2 100644 --- a/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx +++ b/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx @@ -126,8 +126,8 @@ function ChartTable({ if (filterName === 'Mine') { filters.push({ - id: 'created_by', - operator: 'rel_o_m', + id: 'owners', + operator: 'rel_m_m', value: `${user?.userId}`, }); } else if (filterName === 'Favorite') { diff --git a/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx b/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx index e6539b2ad71b..4078e23c2dec 100644 --- a/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx +++ b/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx @@ -136,8 +136,8 @@ function DashboardTable({ const filters = []; if (filterName === 'Mine') { filters.push({ - id: 'created_by', - operator: 'rel_o_m', + id: 'owners', + operator: 'rel_m_m', value: `${user?.userId}`, }); } else if (filterName === 'Favorite') { diff --git a/superset-frontend/src/views/CRUD/welcome/Welcome.tsx b/superset-frontend/src/views/CRUD/welcome/Welcome.tsx index eb9fd6eadb1d..903dcd909cec 100644 --- a/superset-frontend/src/views/CRUD/welcome/Welcome.tsx +++ b/superset-frontend/src/views/CRUD/welcome/Welcome.tsx @@ -197,7 +197,13 @@ function Welcome({ user, addDangerToast }: WelcomeProps) { ); // Sets other activity data in parallel with recents api call - + const ownSavedQueryFilters = [ + { + col: 'owners', + opr: 'rel_m_m', + value: `${id}`, + }, + ]; getUserOwnedObjects(id, 'dashboard') .then(r => { setDashboardData(r); @@ -220,7 +226,7 @@ function Welcome({ user, addDangerToast }: WelcomeProps) { setLoadedCount(loadedCount => loadedCount + 1); addDangerToast(t('There was an issues fetching your chart: %s', err)); }); - getUserOwnedObjects(id, 'saved_query') + getUserOwnedObjects(id, 'saved_query', ownSavedQueryFilters) .then(r => { setQueryData(r); setLoadedCount(loadedCount => loadedCount + 1);