Progress
This commit is contained in:
@@ -4,7 +4,7 @@ import queryString from "query-string";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { useNavigate, useLocation } from "react-router-dom";
|
||||
import { useNavigate, useSearchParams } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import {
|
||||
DELETE_VENDOR,
|
||||
@@ -23,7 +23,7 @@ const mapStateToProps = createStructuredSelector({
|
||||
|
||||
function VendorsFormContainer({ refetch, bodyshop }) {
|
||||
const history = useNavigate();
|
||||
const search = queryString.parse(useLocation().search);
|
||||
const search = queryString.parse(useSearchParams().toString());
|
||||
const { selectedvendor } = search;
|
||||
const [formLoading, setFormLoading] = useState(false);
|
||||
const [form] = Form.useForm();
|
||||
@@ -55,7 +55,7 @@ function VendorsFormContainer({ refetch, bodyshop }) {
|
||||
message: t("vendors.successes.deleted"),
|
||||
});
|
||||
delete search.selectedvendor;
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
history({ search: queryString.stringify(search) });
|
||||
if (refetch)
|
||||
refetch().then((r) => {
|
||||
form.resetFields();
|
||||
@@ -107,7 +107,7 @@ function VendorsFormContainer({ refetch, bodyshop }) {
|
||||
form.resetFields();
|
||||
form.resetFields();
|
||||
delete search.selectedvendor;
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
history({ search: queryString.stringify(search) });
|
||||
setFormLoading(false);
|
||||
} else {
|
||||
notification["error"]({
|
||||
|
||||
Reference in New Issue
Block a user