adding the harvest plan stuff to the field page

This commit is contained in:
csawatzky 2025-09-04 14:38:53 -06:00
parent 84885dc163
commit c69636482a
8 changed files with 146 additions and 36 deletions

View file

@ -9,7 +9,7 @@ import { permissionToString } from "pbHelpers/Permission";
export interface IFieldAPIContext {
addField: (field: pond.FieldSettings, otherTeam?: string) => Promise<any>;
getField: (fieldId: string, otherTeam?: string) => Promise<any>;
getField: (fieldId: string, otherTeam?: string) => Promise<AxiosResponse<pond.Field>>;
listFields: (
limit: number,
offset: number,
@ -53,8 +53,8 @@ export default function FieldProvider(props: PropsWithChildren<Props>) {
const getField = (fieldId: string, otherTeam?: string) => {
const view = otherTeam ? otherTeam : as
if (view) return get(pondURL("/field/" + fieldId + "?as=" + view));
return get(pondURL("/field/" + fieldId));
if (view) return get<pond.Field>(pondURL("/field/" + fieldId + "?as=" + view));
return get<pond.Field>(pondURL("/field/" + fieldId));
};
const removeField = (key: string, otherTeam?: string) => {