Skip to content

Commit

Permalink
ids mandatory for live resources (#4680)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaskikutis authored Jan 30, 2025
1 parent 485855a commit d0cdde1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/core/superdesk-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2367,7 +2367,7 @@ declare module 'superdesk-api' {
}

export interface ILiveResourcesProps {
resources: Array<{resource: string, ids?: Array<string>}>;
resources: Array<{resource: string, ids: Array<string>}>;
children: (result: Array<IRestApiResponse<any>>) => JSX.Element;
}

Expand Down
5 changes: 1 addition & 4 deletions scripts/core/with-resources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ interface IState {
data?: {[resource: string]: IRestApiResponse<unknown>};
}

/**
* Doesn't work with elastic search endpoints, only with mongo ones.
*/
class WithLiveResourcesComponent
extends SuperdeskReactComponent<ILiveResourcesProps & {onInitialized(): void}, IState> {
private eventListenersToRemoveBeforeUnmounting: Array<() => void>;
Expand Down Expand Up @@ -98,7 +95,7 @@ class WithLiveResourcesComponent
}

return Promise.all(
resources.map(({resource, ids}) => {
resources.filter(({ids}) => ids.length > 0).map(({resource, ids}) => {
const query: ISuperdeskQuery = {
filter: {
$and: [
Expand Down

0 comments on commit d0cdde1

Please sign in to comment.