update as in the grain bag api
This commit is contained in:
parent
9b9f4cdf63
commit
1acbfe36b0
9 changed files with 42 additions and 33 deletions
|
|
@ -3,7 +3,7 @@ import SearchSelect, { Option } from "common/SearchSelect";
|
|||
import { GrainOptions } from "grain";
|
||||
import { GrainBag } from "models/GrainBag";
|
||||
import { pond } from "protobuf-ts/pond";
|
||||
import { useGrainBagAPI, useSnackbar } from "providers";
|
||||
import { useGlobalState, useGrainBagAPI, useSnackbar } from "providers";
|
||||
import React, { useState } from "react";
|
||||
import { getDistanceUnit } from "utils";
|
||||
|
||||
|
|
@ -28,6 +28,7 @@ export default function BulkGrainBagSettings(props: Props) {
|
|||
const [bushels, setBushels] = useState<number | undefined>();
|
||||
const [fillDate, setFillDate] = useState<string | undefined>();
|
||||
const [initialMoisture, setInitialMoisture] = useState<number | undefined>();
|
||||
const [{as}] = useGlobalState();
|
||||
|
||||
const convertedDistance = (enteredDistance: number) => {
|
||||
if (getDistanceUnit() === pond.DistanceUnit.DISTANCE_UNIT_FEET) {
|
||||
|
|
@ -60,7 +61,7 @@ export default function BulkGrainBagSettings(props: Props) {
|
|||
});
|
||||
|
||||
grainBagAPI
|
||||
.bulkUpdateGrainBags(bagsToUpdate)
|
||||
.bulkUpdateGrainBags(bagsToUpdate, as)
|
||||
.then(resp => {
|
||||
if (resp.data.successfull > 0) {
|
||||
refreshCallback(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue