Skip to content

Commit

Permalink
fix(search): fix metainfo filter to differentiate search
Browse files Browse the repository at this point in the history
  • Loading branch information
Yelinz committed Jan 29, 2025
1 parent 91ca590 commit a26dfe8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion addon/components/document-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export default class DocumentViewComponent extends Component {
let documents = [];
const filter = this.args.filters || {};
if (filter.query) {
filter.only_newest = true;
filter.onlyNewest = true;
filter.documentMetainfo = filter.metainfo;
delete filter.metainfo;
const searchResult = yield this.store.query(
"search-result",
{
Expand Down
2 changes: 1 addition & 1 deletion addon/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class IndexController extends Controller {
if (this.config && this.config.modelMetaFilters?.document) {
filters = {
...filters,
documentMetainfo: JSON.stringify(this.config.modelMetaFilters.document),
metainfo: JSON.stringify(this.config.modelMetaFilters.document),
};
}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/controllers/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module("Unit | Controller | index", function (hooks) {
assert.deepEqual(controller.documentFilters, {
activeGroup: "group",
categories: 1,
documentMetainfo: JSON.stringify([{ key: "instance_id", value: "1" }]),
metainfo: JSON.stringify([{ key: "instance_id", value: "1" }]),
query: "test",
tags: undefined,
marks: undefined,
Expand Down

0 comments on commit a26dfe8

Please sign in to comment.