mozrest-sdk-react-dev 0.1.52 → 0.1.54
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 -20
- package/package.json +1 -1
package/mozrest-sdk.es.js
CHANGED
|
@@ -46659,9 +46659,7 @@ const GoogleButton$1 = ({
|
|
|
46659
46659
|
onDisconnect("Google");
|
|
46660
46660
|
};
|
|
46661
46661
|
const onLoginSuccess = async ({ code }) => {
|
|
46662
|
-
console.log("onLoginSuccess");
|
|
46663
46662
|
const data2 = await executeGetGoogleAccounts({ code, venueId });
|
|
46664
|
-
console.log("data on login success", data2);
|
|
46665
46663
|
if (!data2) {
|
|
46666
46664
|
return;
|
|
46667
46665
|
}
|
|
@@ -59879,7 +59877,6 @@ const VenueListingDetail = ({
|
|
|
59879
59877
|
const { execute: executePopulateListing } = useService(PopulateListing);
|
|
59880
59878
|
const handlePopulate = () => {
|
|
59881
59879
|
if (googleResponse !== void 0) {
|
|
59882
|
-
console.log("Profile is being populate by Google data");
|
|
59883
59880
|
void executePopulateListing({ venueListingId, module: "Google" });
|
|
59884
59881
|
}
|
|
59885
59882
|
};
|
|
@@ -94840,9 +94837,7 @@ const WorkingPage = () => {
|
|
|
94840
94837
|
}));
|
|
94841
94838
|
};
|
|
94842
94839
|
const GetVenueListingSummary = async () => {
|
|
94843
|
-
console.log("entro en GetVenueListingSummary");
|
|
94844
94840
|
const data2 = await instance$1.get(`listing/venue-listing-summary`);
|
|
94845
|
-
console.log("salgo de GetVenueListingSummary", data2);
|
|
94846
94841
|
return formatData$6(data2);
|
|
94847
94842
|
};
|
|
94848
94843
|
const formatData$6 = (values) => {
|
|
@@ -94876,43 +94871,42 @@ const formatData$6 = (values) => {
|
|
|
94876
94871
|
total: values.total
|
|
94877
94872
|
};
|
|
94878
94873
|
};
|
|
94879
|
-
const singleVenue = async () => {
|
|
94874
|
+
const singleVenue = async (limit = 1) => {
|
|
94880
94875
|
return await instance$1.get(`listing/venue-listing-summary/venues`, {
|
|
94881
94876
|
params: {
|
|
94882
|
-
limit
|
|
94877
|
+
limit,
|
|
94883
94878
|
offset: 0
|
|
94884
94879
|
}
|
|
94885
94880
|
});
|
|
94886
94881
|
};
|
|
94887
94882
|
const redirectToVenueListing = async (data2, navigate) => {
|
|
94888
|
-
console.log("entro en redirectToVenueListing");
|
|
94889
94883
|
if ((data2 == null ? void 0 : data2.total) === 1) {
|
|
94890
94884
|
singleVenue().then((response) => {
|
|
94891
94885
|
navigate(`/venues/${response == null ? void 0 : response.data[0].id}?singleVenue=true`);
|
|
94892
94886
|
return;
|
|
94893
94887
|
});
|
|
94894
94888
|
}
|
|
94895
|
-
|
|
94896
|
-
|
|
94897
|
-
|
|
94898
|
-
|
|
94899
|
-
|
|
94900
|
-
|
|
94901
|
-
|
|
94902
|
-
|
|
94889
|
+
singleVenue(100).then((response) => {
|
|
94890
|
+
const lastVenueManaged = getLastVenueManaged();
|
|
94891
|
+
if (lastVenueManaged) {
|
|
94892
|
+
const venueExists = response == null ? void 0 : response.data.find((venue) => venue.id === lastVenueManaged);
|
|
94893
|
+
if (venueExists) {
|
|
94894
|
+
navigate(`/venues/${lastVenueManaged}?singleVenue=false`);
|
|
94895
|
+
return;
|
|
94896
|
+
}
|
|
94897
|
+
}
|
|
94898
|
+
navigate(`/venues/${response == null ? void 0 : response.data[0].id}?singleVenue=false`);
|
|
94903
94899
|
return;
|
|
94904
|
-
}
|
|
94905
|
-
return;
|
|
94900
|
+
});
|
|
94901
|
+
return null;
|
|
94906
94902
|
};
|
|
94907
94903
|
const Summary = () => {
|
|
94908
|
-
console.log("entro en summary");
|
|
94909
94904
|
const navigate = useNavigate();
|
|
94910
94905
|
const { data: data2, isLoading, error: error3 } = useFetch(GetVenueListingSummary, {
|
|
94911
94906
|
cacheId: "sumary"
|
|
94912
94907
|
});
|
|
94913
94908
|
useEffect(() => {
|
|
94914
94909
|
if (data2) {
|
|
94915
|
-
console.log("entro en useEffect");
|
|
94916
94910
|
redirectToVenueListing(data2, navigate);
|
|
94917
94911
|
}
|
|
94918
94912
|
}, [data2]);
|