Add initial status to approve table

dev
Platon Yasev 3 years ago
parent cacef77eda
commit 740c85390a

@ -8,7 +8,7 @@ import { useUpdateStatus } from "../../../hooks/useUpdateStatus";
export const TakeToWorkButton = () => { export const TakeToWorkButton = () => {
const { filters } = useFilters(); const { filters } = useFilters();
const { prediction, categories } = filters; const { prediction, categories, region } = filters;
const { selection } = usePointSelection(); const { selection } = usePointSelection();
const queryClient = useQueryClient(); const queryClient = useQueryClient();
@ -30,6 +30,16 @@ export const TakeToWorkButton = () => {
"excluded[]": [...selection.excluded], "excluded[]": [...selection.excluded],
}); });
if (region) {
if (region.type === "ao") {
params.append("ao[]", region.id);
}
if (region.type === "rayon") {
params.append("rayon[]", region.id);
}
}
updateStatus(params); updateStatus(params);
}; };

@ -12,6 +12,7 @@ import { useUpdateStatus } from "../../../hooks/useUpdateStatus";
const statusOptions = [ const statusOptions = [
{ label: STATUSES.approve, value: STATUSES.approve }, { label: STATUSES.approve, value: STATUSES.approve },
{ label: STATUSES.working, value: STATUSES.working }, { label: STATUSES.working, value: STATUSES.working },
{ label: STATUSES.initial, value: STATUSES.initial },
]; ];
const StatusSelect = ({ value, onChange, disabled }) => { const StatusSelect = ({ value, onChange, disabled }) => {

Loading…
Cancel
Save