mozrest-sdk-react-dev 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/mozrest-sdk.es.js +14 -7
  2. package/package.json +1 -1
package/mozrest-sdk.es.js CHANGED
@@ -81814,19 +81814,26 @@ const MetricCard = ({ value: value2, title: title2 }) => /* @__PURE__ */ React__
81814
81814
  }, /* @__PURE__ */ React__default.createElement("span", {
81815
81815
  className: styles$6.value
81816
81816
  }, value2));
81817
+ const singleVenue = async () => {
81818
+ return await instance$1.get(`listing/venue-listing-summary/venues`, {
81819
+ params: {
81820
+ limit: 1,
81821
+ offset: 0
81822
+ }
81823
+ });
81824
+ };
81817
81825
  const Summary = () => {
81818
81826
  const { t: t2 } = useTranslation();
81819
81827
  const navigate = useNavigate();
81820
81828
  const { data: data2, isLoading, error: error3 } = useFetch(GetVenueListingSummary, {
81821
81829
  cacheId: "sumary"
81822
- }, {
81823
- onSuccess: (response) => {
81824
- if ((response == null ? void 0 : response.total) === 1) {
81825
- navigate("/venues/venueId");
81826
- return;
81827
- }
81828
- }
81829
81830
  });
81831
+ if ((data2 == null ? void 0 : data2.total) === 1) {
81832
+ singleVenue().then((response) => {
81833
+ navigate(`/venues/${response == null ? void 0 : response.data[0].id}`);
81834
+ return;
81835
+ });
81836
+ }
81830
81837
  if (isLoading || (data2 == null ? void 0 : data2.total) === 1) {
81831
81838
  return /* @__PURE__ */ React__default.createElement(SkeletonPage, null);
81832
81839
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mozrest-sdk-react-dev",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "main": "mozrest-sdk.es.js",
5
5
  "keywords": ["mozrest"],
6
6
  "author": {