Change UpdatePage Reducer

Summary: The different is small after the change from storing pre-rendered data to raw data. Hence, the diff changes it to match `currentPage` to ease the assignment (used in next diffs)

Reviewed By: jknoxville

Differential Revision: D21788245

fbshipit-source-id: 87bdbce33f0615bf31878797a74fce5d5969db7b
This commit is contained in:
Chaiwat Ekkaewnumchai
2020-06-02 01:44:21 -07:00
committed by Facebook GitHub Bot
parent d6b617a952
commit fe17ddce1a

View File

@@ -169,14 +169,7 @@ type UpdateViewModeEvent = {
type UpdatePageEvent = { type UpdatePageEvent = {
type: 'UpdatePage'; type: 'UpdatePage';
databaseId: number; } & Page;
table: string;
columns: Array<string>;
values: Array<Array<Value>>;
start: number;
count: number;
total: number;
};
type UpdateStructureEvent = { type UpdateStructureEvent = {
type: 'UpdateStructure'; type: 'UpdateStructure';
@@ -481,11 +474,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
): DatabasesPluginState => { ): DatabasesPluginState => {
return { return {
...state, ...state,
currentPage: { currentPage: event,
rows: event.values,
highlightedRows: [],
...event,
},
}; };
}, },
], ],
@@ -817,10 +806,11 @@ export default class DatabasesPlugin extends FlipperPlugin<
databaseId: databaseId, databaseId: databaseId,
table: table, table: table,
columns: data.columns, columns: data.columns,
values: data.values, rows: data.values,
start: data.start, start: data.start,
count: data.count, count: data.count,
total: data.total, total: data.total,
highlightedRows: [],
}); });
}) })
.catch((e) => { .catch((e) => {