Browse Source

Merge pull request 'fix local & remote search to return the same results, fix beforeId check, fix handleId reference' (#41) from similarify-search into master

Reviewed-on: https://gitea.anomalistdesign.com/trent_larson/kick-starter-for-time-pwa/pulls/41
pull/44/head
anomalist 1 year ago
parent
commit
78b98bab5e
  1. 15
      src/views/DiscoverView.vue

15
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 });
}

Loading…
Cancel
Save