Skip to content

Commit e3f8de8

Browse files
committed
Change structure of serialized filters
1 parent 3117e64 commit e3f8de8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

server/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const data = loadAndProcessData('src/ndx.csv');
1313
const adaptor = creatAdapter(data);
1414

1515
app.post('/api/stock', (req, res) => {
16-
adaptor.filterStorage.restore(req.body);
16+
adaptor.filterStorage.restore(req.body.filters);
1717
console.log(`${adaptor.groupAll.value()} of ${adaptor.cf.size()}`);
1818
const result = adaptor.computeChartData();
1919
res.json(result);

src/remote/remote-data-source.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class RemoteDataSource {
4545
'Content-Type': 'application/json',
4646
},
4747
redirect: 'follow',
48-
body: JSON.stringify(serializedFilters),
48+
body: JSON.stringify({ filters: serializedFilters }),
4949
});
5050
const txtBody = await response.text();
5151
return JSON.parse(txtBody, dateTimeReviver);

0 commit comments

Comments
 (0)