@lodashventure/medusa-hero 1.0.16 → 1.0.18
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.
|
@@ -772,7 +772,8 @@ const HeroPage = () => {
|
|
|
772
772
|
const [isLoading, setIsLoading] = react.useState(false);
|
|
773
773
|
const dialog = ui.usePrompt();
|
|
774
774
|
const { data: heroData, refetch } = useHeroes();
|
|
775
|
-
const { count = 0, heroes
|
|
775
|
+
const { count = 0, heroes: rawHeroes } = heroData || {};
|
|
776
|
+
const heroes = Array.isArray(rawHeroes) ? rawHeroes : [];
|
|
776
777
|
const sensors = core.useSensors(
|
|
777
778
|
core.useSensor(core.PointerSensor, {
|
|
778
779
|
activationConstraint: {
|
|
@@ -861,9 +862,9 @@ const HeroPage = () => {
|
|
|
861
862
|
headers: {
|
|
862
863
|
"Content-Type": "application/json"
|
|
863
864
|
},
|
|
864
|
-
body: {
|
|
865
|
+
body: JSON.stringify({
|
|
865
866
|
ids: orderedHeroes.map((hero) => hero.id)
|
|
866
|
-
}
|
|
867
|
+
})
|
|
867
868
|
});
|
|
868
869
|
setReorderMode(false);
|
|
869
870
|
refetch();
|
|
@@ -768,7 +768,8 @@ const HeroPage = () => {
|
|
|
768
768
|
const [isLoading, setIsLoading] = useState(false);
|
|
769
769
|
const dialog = usePrompt();
|
|
770
770
|
const { data: heroData, refetch } = useHeroes();
|
|
771
|
-
const { count = 0, heroes
|
|
771
|
+
const { count = 0, heroes: rawHeroes } = heroData || {};
|
|
772
|
+
const heroes = Array.isArray(rawHeroes) ? rawHeroes : [];
|
|
772
773
|
const sensors = useSensors(
|
|
773
774
|
useSensor(PointerSensor, {
|
|
774
775
|
activationConstraint: {
|
|
@@ -857,9 +858,9 @@ const HeroPage = () => {
|
|
|
857
858
|
headers: {
|
|
858
859
|
"Content-Type": "application/json"
|
|
859
860
|
},
|
|
860
|
-
body: {
|
|
861
|
+
body: JSON.stringify({
|
|
861
862
|
ids: orderedHeroes.map((hero) => hero.id)
|
|
862
|
-
}
|
|
863
|
+
})
|
|
863
864
|
});
|
|
864
865
|
setReorderMode(false);
|
|
865
866
|
refetch();
|