[WIKI-556] chore: disable tracking of page hover (#7650)

* chore: disable tracking of page hover

* chore: add track check for page feth

* chore: make track check mandatory

* chore: update track format

---------

Co-authored-by: VipinDevelops <vipinchaudhary1809@gmail.com>
This commit is contained in:
Bavisetti Narayan 2025-08-28 20:02:44 +05:30 committed by GitHub
parent ba7303b7af
commit e144ce8cf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 32 additions and 13 deletions

View file

@ -23,8 +23,12 @@ export class ProjectPageService extends APIService {
});
}
async fetchById(workspaceSlug: string, projectId: string, pageId: string): Promise<TPage> {
return this.get(`/api/workspaces/${workspaceSlug}/projects/${projectId}/pages/${pageId}/`)
async fetchById(workspaceSlug: string, projectId: string, pageId: string, trackVisit: boolean): Promise<TPage> {
return this.get(`/api/workspaces/${workspaceSlug}/projects/${projectId}/pages/${pageId}/`, {
params: {
track_visit: trackVisit,
},
})
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;

View file

@ -49,7 +49,12 @@ export interface IProjectPageStore {
projectId: string,
pageType?: TPageNavigationTabs
) => Promise<TPage[] | undefined>;
fetchPageDetails: (workspaceSlug: string, projectId: string, pageId: string) => Promise<TPage | undefined>;
fetchPageDetails: (
workspaceSlug: string,
projectId: string,
pageId: string,
{ trackVisit }: { trackVisit: boolean }
) => Promise<TPage | undefined>;
createPage: (pageData: Partial<TPage>) => Promise<TPage | undefined>;
removePage: (pageId: string) => Promise<void>;
movePage: (workspaceSlug: string, projectId: string, pageId: string, newProjectId: string) => Promise<void>;
@ -239,7 +244,12 @@ export class ProjectPageStore implements IProjectPageStore {
* @description fetch the details of a page
* @param {string} pageId
*/
fetchPageDetails = async (workspaceSlug: string, projectId: string, pageId: string) => {
fetchPageDetails = async (
workspaceSlug: string,
projectId: string,
pageId: string,
{ trackVisit }: { trackVisit: boolean }
) => {
try {
if (!workspaceSlug || !projectId || !pageId) return undefined;
@ -249,7 +259,7 @@ export class ProjectPageStore implements IProjectPageStore {
this.error = undefined;
});
const page = await this.service.fetchById(workspaceSlug, projectId, pageId);
const page = await this.service.fetchById(workspaceSlug, projectId, pageId, trackVisit);
runInAction(() => {
if (page?.id) {