From 2493f2ad39306d3d515af675a8214f442aff9e86 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Tue, 11 Jul 2023 21:16:57 -0600 Subject: [PATCH] fix local & remote search to work, fix beforeId check, fix handleId setting --- src/views/DiscoverView.vue | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/views/DiscoverView.vue b/src/views/DiscoverView.vue index 659d41508..a223f72e3 100644 --- a/src/views/DiscoverView.vue +++ b/src/views/DiscoverView.vue @@ -164,14 +164,11 @@ export default class DiscoverView extends Vue { } public async search(beforeId?: string) { - const claimContents = - "claimContents=" + encodeURIComponent(this.searchTerms); - const claimType = "claimType=PlanAction"; - let queryParams = [claimContents, claimType].join("&"); + let queryParams = "claimContents=" + encodeURIComponent(this.searchTerms); console.log(beforeId); if (beforeId) { - queryParams = queryParams + `beforeId=${beforeId}`; + queryParams = queryParams + `&beforeId=${beforeId}`; } this.isRemoteActive = true; @@ -180,7 +177,7 @@ export default class DiscoverView extends Vue { try { this.isLoading = true; const response = await fetch( - this.apiServer + "/api/v2/report/claims?" + queryParams, + this.apiServer + "/api/v2/report/plans?" + queryParams, { method: "GET", headers: await this.buildHeaders(), @@ -197,7 +194,7 @@ export default class DiscoverView extends Vue { const plans: ProjectData[] = results.data; if (plans) { for (const plan of plans) { - const { name, description, handleId = plan.fullIri, rowid } = plan; + const { name, description, handleId = plan.handleId, rowid } = plan; console.log("here"); this.projects.push({ name, description, handleId, rowid }); } @@ -227,7 +224,7 @@ export default class DiscoverView extends Vue { ].join("&"); if (beforeId) { - queryParams = queryParams + `beforeId=${beforeId}`; + queryParams = queryParams + `&beforeId=${beforeId}`; } try { @@ -252,7 +249,7 @@ export default class DiscoverView extends Vue { if (beforeId) { const plans: ProjectData[] = results.data; for (const plan of plans) { - const { name, description, handleId = plan.fullIri, rowid } = plan; + const { name, description, handleId = plan.handleId, rowid } = plan; if (beforeId !== plan["rowid"]) { this.projects.push({ name, description, handleId, rowid }); }