fixed permission issue causing problems with simple export

This commit is contained in:
csawatzky 2025-04-24 14:10:55 -06:00
parent 7c5332662d
commit b7e21a8fa1
3 changed files with 20 additions and 17 deletions

View file

@ -131,7 +131,7 @@ export interface IDeviceAPIContext {
orderBy: string,
as?: string
) => Promise<AxiosResponse<pond.ListDeviceExportedMeasurementsResponse>>;
listSimpleJSON: (device: number) => Promise<any>;
listSimpleJSON: (device: number, as?: string) => Promise<any>;
resetQuackCount: (id: number) => Promise<any>;
resetQuackCountTx: (id: number) => Promise<any>;
resetQuackCountTx1000: (id: number) => Promise<any>;
@ -832,9 +832,11 @@ export default function DeviceProvider(props: PropsWithChildren<Props>) {
);
};
const listSimpleJSON = (device: number) => {
const listSimpleJSON = (device: number, as?: string) => {
let url = "/devices/" + device + "/measurements/exportSimple"
if(as) url = url + "?as=" + as
return new Promise<AxiosResponse>((resolve, reject) => {
get(pondURL("/devices/" + device + "/measurements/exportSimple")).then(resp => {
get(pondURL(url)).then(resp => {
return resolve(resp)
}).catch(err => {
return reject(err)