Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
devketanpro committed Dec 19, 2024
1 parent 3bf1f08 commit 81306e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion assets/agenda/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export function fetchItemsById(ids: Array<string>): Promise<IRestApiResponse<IAg
return server.get(`/agenda/search?ids=${ids.join(', ')}`);
}

export function fetchItemsByIdToRedux(ids: string[]): (dispatch: any) => Promise<void> {
export function fetchItemsByIdToRedux(ids: Array<string>): (dispatch: any) => Promise<void> {
return (dispatch: any) => {
return fetchItemsById(ids).then((response) => {
dispatch(recieveItem(response));
Expand Down
10 changes: 4 additions & 6 deletions assets/agenda/components/AgendaPreviewEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ import AgendaInternalNote from './AgendaInternalNote';
import {IAgendaItem} from 'interfaces';

interface AgendaPreviewEventProps {
item: {
event_ids: Array<IAgendaItem['_id']>;
};
item: IAgendaItem;
itemsById: Record<string, IAgendaItem>;
eventIds: string[];
fetchItemsByIdToRedux: (ids: string[]) => Promise<void>;
eventIds: Array<string>;
fetchItemsByIdToRedux: (ids: Array<string>) => Promise<void>;
}

interface AgendaPreviewEventState {
Expand Down Expand Up @@ -155,7 +153,7 @@ const mapStateToProps = (state: any, ownProps: any) => ({
});

const mapDispatchToProps = (dispatch: any) => ({
fetchItemsByIdToRedux: (ids: string[]) => dispatch(fetchItemsByIdToRedux(ids)),
fetchItemsByIdToRedux: (ids: Array<string>) => dispatch(fetchItemsByIdToRedux(ids)),
});

export const AgendaPreviewEvent = connect(mapStateToProps, mapDispatchToProps)(AgendaPreviewEventComponent);
4 changes: 2 additions & 2 deletions assets/agenda/components/AgendaPreviewPlanning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface IOwnProps {
restrictCoverageInfo?: boolean;
previewConfig: IAgendaPreviewConfig;
planningItems?: Array<IAgendaItem>;
fetchItemsByIdToRedux: (ids: string[]) => Promise<void>;
fetchItemsByIdToRedux: (ids: Array<string>) => Promise<void>;
}

interface IReduxStateProps {
Expand Down Expand Up @@ -229,7 +229,7 @@ const mapStateToProps = (state: any, ownProps: any) => {
};

const mapDispatchToProps = (dispatch: any) => ({
fetchItemsByIdToRedux: (ids: string[]) => dispatch(fetchItemsByIdToRedux(ids)),
fetchItemsByIdToRedux: (ids: Array<string>) => dispatch(fetchItemsByIdToRedux(ids)),
});

export const AgendaPreviewPlanning = connect(mapStateToProps, mapDispatchToProps)(AgendaPreviewPlanningComponent);

0 comments on commit 81306e6

Please sign in to comment.