mozrest-sdk-react-dev 0.1.52 → 0.1.53
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.
- package/mozrest-sdk.es.js +14 -17
- package/package.json +1 -1
package/mozrest-sdk.es.js
CHANGED
|
@@ -94840,9 +94840,7 @@ const WorkingPage = () => {
|
|
|
94840
94840
|
}));
|
|
94841
94841
|
};
|
|
94842
94842
|
const GetVenueListingSummary = async () => {
|
|
94843
|
-
console.log("entro en GetVenueListingSummary");
|
|
94844
94843
|
const data2 = await instance$1.get(`listing/venue-listing-summary`);
|
|
94845
|
-
console.log("salgo de GetVenueListingSummary", data2);
|
|
94846
94844
|
return formatData$6(data2);
|
|
94847
94845
|
};
|
|
94848
94846
|
const formatData$6 = (values) => {
|
|
@@ -94876,43 +94874,42 @@ const formatData$6 = (values) => {
|
|
|
94876
94874
|
total: values.total
|
|
94877
94875
|
};
|
|
94878
94876
|
};
|
|
94879
|
-
const singleVenue = async () => {
|
|
94877
|
+
const singleVenue = async (limit = 1) => {
|
|
94880
94878
|
return await instance$1.get(`listing/venue-listing-summary/venues`, {
|
|
94881
94879
|
params: {
|
|
94882
|
-
limit
|
|
94880
|
+
limit,
|
|
94883
94881
|
offset: 0
|
|
94884
94882
|
}
|
|
94885
94883
|
});
|
|
94886
94884
|
};
|
|
94887
94885
|
const redirectToVenueListing = async (data2, navigate) => {
|
|
94888
|
-
console.log("entro en redirectToVenueListing");
|
|
94889
94886
|
if ((data2 == null ? void 0 : data2.total) === 1) {
|
|
94890
94887
|
singleVenue().then((response) => {
|
|
94891
94888
|
navigate(`/venues/${response == null ? void 0 : response.data[0].id}?singleVenue=true`);
|
|
94892
94889
|
return;
|
|
94893
94890
|
});
|
|
94894
94891
|
}
|
|
94895
|
-
|
|
94896
|
-
|
|
94897
|
-
|
|
94898
|
-
|
|
94899
|
-
|
|
94900
|
-
|
|
94901
|
-
|
|
94902
|
-
|
|
94892
|
+
singleVenue(100).then((response) => {
|
|
94893
|
+
const lastVenueManaged = getLastVenueManaged();
|
|
94894
|
+
if (lastVenueManaged) {
|
|
94895
|
+
const venueExists = response == null ? void 0 : response.data.find((venue) => venue.id === lastVenueManaged);
|
|
94896
|
+
if (venueExists) {
|
|
94897
|
+
navigate(`/venues/${lastVenueManaged}?singleVenue=false`);
|
|
94898
|
+
return;
|
|
94899
|
+
}
|
|
94900
|
+
}
|
|
94901
|
+
navigate(`/venues/${response == null ? void 0 : response.data[0].id}?singleVenue=false`);
|
|
94903
94902
|
return;
|
|
94904
|
-
}
|
|
94905
|
-
return;
|
|
94903
|
+
});
|
|
94904
|
+
return null;
|
|
94906
94905
|
};
|
|
94907
94906
|
const Summary = () => {
|
|
94908
|
-
console.log("entro en summary");
|
|
94909
94907
|
const navigate = useNavigate();
|
|
94910
94908
|
const { data: data2, isLoading, error: error3 } = useFetch(GetVenueListingSummary, {
|
|
94911
94909
|
cacheId: "sumary"
|
|
94912
94910
|
});
|
|
94913
94911
|
useEffect(() => {
|
|
94914
94912
|
if (data2) {
|
|
94915
|
-
console.log("entro en useEffect");
|
|
94916
94913
|
redirectToVenueListing(data2, navigate);
|
|
94917
94914
|
}
|
|
94918
94915
|
}, [data2]);
|