From 10728339e0cab6b301b013c52d86e39376b08a54 Mon Sep 17 00:00:00 2001 From: Mehmood Ahmad <31419912+mehmoodak@users.noreply.github.com> Date: Thu, 9 Apr 2026 00:08:54 +0500 Subject: [PATCH] =?UTF-8?q?=E2=9E=95=20ADDS:=20caller=20param=20to=20users?= =?UTF-8?q?/sites=20endpoint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reader/user-profile/queries/use-user-sites-query.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/reader/user-profile/queries/use-user-sites-query.ts b/client/reader/user-profile/queries/use-user-sites-query.ts index a5eddd774618..944abe8a386a 100644 --- a/client/reader/user-profile/queries/use-user-sites-query.ts +++ b/client/reader/user-profile/queries/use-user-sites-query.ts @@ -1,5 +1,10 @@ import { callApi } from '@automattic/data-stores/src/reader'; import { UseQueryResult, useQuery } from '@tanstack/react-query'; +import { addQueryArgs } from '@wordpress/url'; + +interface UserSitesQueryParams { + caller: string; // To identify the caller of the API which filter the sites accordingly. +} export interface UserSitesResponse { total: number; @@ -31,7 +36,9 @@ export default function useUserSitesQuery( queryFn: () => callApi< UserSitesResponse >( { apiNamespace: 'wpcom/v2', - path: `/users/${ userId }/sites`, + path: addQueryArgs( `/users/${ userId }/sites`, { + caller: 'reader', + } as UserSitesQueryParams ), method: 'GET', isLoggedIn: true, apiVersion: '2',