delete point updates table, popup fix

dev
RekHoto 2 years ago
parent f4611ffc34
commit 6011c4f4c1

@ -95,7 +95,8 @@ export const FeatureProperties = ({ feature, dynamicStatus, postamatId, point })
}
if (type === "region") {
value = value ? value : point[fallbackField];
const valueProvider = point ? point : feature
value = value ? value : valueProvider[fallbackField];
value = render(value, data?.normalized);
} else {
value = render ? render(value) : value;

@ -5,9 +5,11 @@ import { STATUSES } from "../../../config";
import { usePendingPointsFilters } from "../../../stores/usePendingPointsFilters";
import { appendFiltersInUse } from "../../../utils.js";
import { useMode } from "../../../stores/useMode.js";
import { useUpdateLayerCounter } from "../../../stores/useUpdateLayerCounter.js";
export const usePendingTableData = (page, resetPage, pageSize, setPageSize, sort) => {
const { filters, ranges } = usePendingPointsFilters();
const { updateCounter } = useUpdateLayerCounter();
const {
categories,
region,
@ -31,7 +33,7 @@ export const usePendingTableData = (page, resetPage, pageSize, setPageSize, sort
}
const {data, isInitialLoading, isFetching} = useQuery(
["table", page, filters, sort, dbTable],
["table", page, filters, sort, dbTable, updateCounter],
async () => {
const params = getParams();

@ -3,6 +3,7 @@ import React, { useMemo } from "react";
import { Button } from "antd";
import { BiTrash } from "react-icons/all.js";
import { deletePoint } from "../../../api.js";
import { useUpdateLayerCounter } from "../../../stores/useUpdateLayerCounter.js";
const MATCHING_STATUS = {
New: {
@ -22,10 +23,12 @@ const MATCHING_STATUS = {
export const usePendingTableFields = () => {
const { isImportMode } = useMode();
const { toggleUpdateCounter } = useUpdateLayerCounter();
const deleteRow = async (e, id) => {
e.stopPropagation();
try {
await deletePoint(id);
toggleUpdateCounter();
} catch (e) {
//
}

Loading…
Cancel
Save