Closed ay-bh closed 3 months ago
marshmallow is already imported with ma so we could use ma.validate instead
@aaron-wu1 We need to import validate
directly to access Marshmallow's validation functions, which aren't available as attributes of the Marshmallow instance (ma
).
Implemented enhancements to the "export to csv" functionality on the dashboard. With this update, users can now export raw data for multiple cells as separate CSV files, addressing the issue where previously only aggregated hourly data could be exported for a single cell, resolves #203.
Changes Made:
Added a
resample
query parameter to the backend API endpoint/api/cell/data/${cellId}
, allowing the API to handle raw data export whenresample=none
is specified. This parameter is used to determine whether to perform data resampling or to fetch raw data.Updated the backend database models to handle the new
resample
logic.Revised the
getCellData
schema to include theresample
parameter, enabling front-end requests to specify the desired resampling strategy.Altered the front-end logic in
DownloadBtn.jsx
to pass theresample=none
parameter when initiating the data download, ensuring that raw data is exported.Testing Performed:
Manual testing was conducted to ensure the new functionalities work as expected. This includes:
EDIT: It also closes #210