Skip to content

Commit d95e5a6

Browse files
authored
Merge pull request #4530 from bjester/import-search-clipboard
Properly format node_id+channel_id query parameter
2 parents 6d74de8 + 19a15f5 commit d95e5a6

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

contentcuration/contentcuration/frontend/channelEdit/vuex/clipboard/actions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export function addClipboardNodeFromListener(context, obj) {
193193
.then(() =>
194194
context.dispatch(
195195
'contentNode/loadContentNodes',
196-
{ '[node_id+channel_id]__in': [obj.source_node_id, obj.source_channel_id] },
196+
{ '[node_id+channel_id]__in': [[obj.source_node_id, obj.source_channel_id]] },
197197
{ root }
198198
)
199199
)

contentcuration/contentcuration/frontend/shared/data/__tests__/ContentNodeResource.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ describe('ContentNode methods', () => {
720720
);
721721
expect(table.get).toHaveBeenCalledWith({ '[node_id+channel_id]': [node_id, channel_id] });
722722
expect(fetchCollection).toHaveBeenCalledWith({
723-
_node_id_channel_id_: [node_id, channel_id],
723+
'[node_id+channel_id]__in': [[node_id, channel_id]],
724724
});
725725
});
726726

@@ -731,7 +731,7 @@ describe('ContentNode methods', () => {
731731
await expect(ContentNode.getByNodeIdChannelId(node_id, channel_id)).resolves.toBeFalsy();
732732
expect(table.get).toHaveBeenCalledWith({ '[node_id+channel_id]': [node_id, channel_id] });
733733
expect(fetchCollection).toHaveBeenCalledWith({
734-
_node_id_channel_id_: [node_id, channel_id],
734+
'[node_id+channel_id]__in': [[node_id, channel_id]],
735735
});
736736
});
737737
});

contentcuration/contentcuration/frontend/shared/data/resources.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,9 @@ export const ContentNode = new TreeResource({
16441644
const values = [nodeId, channelId];
16451645
return this.table.get({ '[node_id+channel_id]': values }).then(node => {
16461646
if (!node) {
1647-
return this.fetchCollection({ _node_id_channel_id_: values }).then(nodes => nodes[0]);
1647+
return this.fetchCollection({ '[node_id+channel_id]__in': [values] }).then(
1648+
nodes => nodes[0]
1649+
);
16481650
}
16491651
return node;
16501652
});

0 commit comments

Comments
 (0)