Skip to content

Commit

Permalink
[INV-3763] actions to creators (#3765)
Browse files Browse the repository at this point in the history
* Convert actions to actionCreators

* Convert actions to actionCreators, reduce map.ts
  • Loading branch information
LocalNewsTV authored Dec 31, 2024
1 parent 629e45c commit 64ef9f6
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 278 deletions.
5 changes: 0 additions & 5 deletions app/src/state/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ export const IAPP_GEOJSON_GET_REQUEST = 'IAPP_GEOJSON_GET_REQUEST';
export const IAPP_GEOJSON_GET_ONLINE = 'IAPP_GEOJSON_GET_ONLINE';
export const IAPP_GEOJSON_GET_SUCCESS = 'IAPP_GEOJSON_GET_SUCCESS';

export const ACTIVITIES_TABLE_ROWS_GET_REQUEST = 'ACTIVITIES_TABLE_ROWS_GET_REQUEST';
export const ACTIVITIES_TABLE_ROWS_GET_ONLINE = 'ACTIVITIES_TABLE_ROWS_GET_ONLINE';
export const ACTIVITIES_TABLE_ROWS_GET_SUCCESS = 'ACTIVITIES_TABLE_ROWS_GET_SUCCESS';
export const ACTIVITIES_TABLE_ROWS_GET_FAILURE = 'ACTIVITIES_TABLE_ROWS_GET_FAILURE';

export const MAP_INIT_REQUEST = 'MAP_INIT_REQUEST';
export const MAP_INIT_FOR_RECORDSET = 'MAP_INIT_FOR_RECORDSET';

Expand Down
18 changes: 18 additions & 0 deletions app/src/state/actions/activity/Activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ export interface ICreateLocal {
id: string;
data: Record<string, any>;
}
export interface ActivityTableRowRequest {
recordSetID: string | number;
tableFiltersHash: Record<PropertyKey, any>;
page: number;
limit: number;
}

export interface ActivityTableRowGetRequest extends ActivityTableRowRequest {
filterObj: Record<PropertyKey, any>;
}
export interface ActivityTableRowsGetSuccess extends ActivityTableRowRequest {
rows: Record<PropertyKey, any>[];
}

class Activity {
private static readonly PREFIX = 'Activity';
static readonly Offline = Offline;
Expand Down Expand Up @@ -59,5 +73,9 @@ class Activity {
static readonly getFailure = createAction(`${this.PREFIX}/getFailure`, (arg?: Response) => ({
payload: arg
}));

static readonly getRows = createAction<ActivityTableRowRequest>(`${this.PREFIX}/getRows`);
static readonly getRowsRequest = createAction<ActivityTableRowGetRequest>(`${this.PREFIX}/getRowsRequest`);
static readonly getRowsSuccess = createAction<ActivityTableRowsGetSuccess>(`${this.PREFIX}/getRowsSuccess`);
}
export default Activity;
Loading

0 comments on commit 64ef9f6

Please sign in to comment.