added function to the bin model to get the bushels from either the settings or the status based on the inventory control and replaced the instances in the bin card and visualizer where it was getting it from the settings with the function
This commit is contained in:
parent
acbd49b907
commit
b197f34f33
5 changed files with 132 additions and 109 deletions
|
|
@ -126,6 +126,10 @@ export interface IBinAPIContext {
|
|||
showErrors?: boolean,
|
||||
otherTeam?: string
|
||||
) => Promise<AxiosResponse<pond.ListObjectMeasurementsResponse>>;
|
||||
getBinsTrendData: (
|
||||
bins: string[],
|
||||
days: number
|
||||
) => Promise<AxiosResponse<pond.GetBinsTrendDataResponse>>;
|
||||
}
|
||||
|
||||
export const BinAPIContext = createContext<IBinAPIContext>({} as IBinAPIContext);
|
||||
|
|
@ -629,6 +633,12 @@ export default function BinProvider(props: PropsWithChildren<Props>) {
|
|||
})
|
||||
};
|
||||
|
||||
const getBinsTrendData = (bins: string[], days: number) => {
|
||||
return get<pond.GetBinsTrendDataResponse>(
|
||||
pondURL("/binTrends?bins=" + bins.toString() + "&days=" + days + (as ? "&as=" + as : ""))
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<BinAPIContext.Provider
|
||||
value={{
|
||||
|
|
@ -655,7 +665,8 @@ export default function BinProvider(props: PropsWithChildren<Props>) {
|
|||
listHistoryBetween,
|
||||
listBinPrefs,
|
||||
updateTopNodes,
|
||||
listBinMeasurements
|
||||
listBinMeasurements,
|
||||
getBinsTrendData
|
||||
}}>
|
||||
{children}
|
||||
</BinAPIContext.Provider>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue