Merged in fix/LOY-400-make-contentstack-data-optional (pull request #3266)

fix(LOY-400): made contentstack data optional so the whole page does not crash if it's empty.

* fix(LOY-400): made contentstack data optional so the whole page does not crash if it's empty.

* Merged in fix/LOY-400-make-contentstack-data-optional-2 (pull request #3269)

Fix/LOY-400 make contentstack data optional 2

* Test

* .

* Correct ref tag

* refactor

* Correct key

* fix(LOY-400): cleaned up


Approved-by: Linus Flood
Approved-by: Matilda Landström
This commit is contained in:
Emma Zettervall
2025-12-02 08:08:12 +00:00
parent 95473927f2
commit 34526bbaf1
5 changed files with 95 additions and 68 deletions
@@ -0,0 +1,17 @@
import type { System } from "../schemas/system"
import type { UsePointsModalRefsData } from "./output"
export function getConnections({ all_usepointsmodal }: UsePointsModalRefsData) {
const connections: System["system"][] = all_usepointsmodal?.items?.[0]
? [all_usepointsmodal?.items?.[0]?.system]
: []
if (all_usepointsmodal && all_usepointsmodal.items) {
all_usepointsmodal?.items.forEach((item) => {
item.link_group.forEach((link) => {
link.link?.uid && connections.push(link.link)
})
})
}
return connections
}