Skip to content
Snippets Groups Projects
Commit e8f48389 authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier
Browse files

fix: issue 2, phone and email reactivity

parent bdf7bf74
No related branches found
Tags v5.0.11
No related merge requests found
Pipeline #19363 passed with stage
in 30 seconds
......@@ -21,15 +21,41 @@ if (import.meta.env.DEV) {
// Workaround : https://git.startinblox.com/projets/projets-clients/tzcld/-/issues/2
document.addEventListener("DOMContentLoaded", () => {
document.addEventListener("save", (e) => {
if(e.detail?.id?.includes("communities")) {
if (e.detail?.id?.includes("communities")) {
const locations = e.detail?.resource?.tzcld_profile?.locations;
if(locations) {
for(const location of locations) {
if (locations) {
for (const location of locations) {
sibStore.clearCache(location["@id"]);
sibStore.getData(location["@id"], {}).then(() => {
for(const solidForm of document.querySelectorAll(`solid-form[data-src='${location["@id"]}']`)) {
for (const solidForm of document.querySelectorAll(
`solid-form[data-src='${location["@id"]}']`,
)) {
solidForm.component?.populate();
}
if (location.phones) {
for (const phone of location.phones) {
sibStore.clearCache(phone["@id"]);
sibStore.getData(phone["@id"], {}).then(() => {
for (const solidForm of document.querySelectorAll(
`solid-form[data-src='${phone["@id"]}']`,
)) {
solidForm.component?.populate();
}
});
}
}
if (location.emails) {
for (const email of location.emails) {
sibStore.clearCache(email["@id"]);
sibStore.getData(email["@id"], {}).then(() => {
for (const solidForm of document.querySelectorAll(
`solid-form[data-src='${email["@id"]}']`,
)) {
solidForm.component?.populate();
}
});
}
}
});
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment