Closed jbkolze closed 3 weeks ago
Code, as requested:
import { useQuery } from "@tanstack/react-query";
import { Configuration, TimeseriesGroupsApi } from "cwmsjs";
const useCdaTimeSeriesGroup = ({ cdaParams, cdaUrl, queryOptions }) => {
const configOptions = {
headers: {
accept: "application/json",
},
};
if (cdaUrl) configOptions.basePath = cdaUrl;
const configV2 = new Configuration(configOptions);
const timeseriesGroupsApi = new TimeseriesGroupsApi(configV2);
return useQuery({
queryKey: ["cda", "timeseries-group", cdaParams.groupId],
queryFn: async () =>
timeseriesGroupsApi.getCwmsDataTimeseriesGroupWithGroupId(cdaParams),
...queryOptions,
});
};
export { useCdaTimeSeriesGroup };
export default useCdaTimeSeriesGroup;
useCdaTimeSeriesGroup({
cdaParams: {
groupId: "USGS TS Data Acquisition",
office: "CWMS",
categoryId: "Data Acquisition",
},
});
Believe this was resolved and we are waiting to push the code because of the typescript changes
Data appears to be getting lost between the actual response and the returned object.
Using the
getCwmsDataTimeseriesGroupWithGroupId()
function with the following parameters:{ groupId: "USGS TS Data Acquisition", office: "CWMS", categoryId: "Data Acquisition", }
The following response is returned:
but in the returned object the assignedTimeSeries entries are all like this: