diff --git a/apps/adm/src/views/SectionEditView.vue b/apps/adm/src/views/SectionEditView.vue
index be557c7..7e83f00 100644
--- a/apps/adm/src/views/SectionEditView.vue
+++ b/apps/adm/src/views/SectionEditView.vue
@@ -120,13 +120,12 @@
+
+ ایمیل، تلفن، آدرس و شبکههای اجتماعی از بخش «تنظیمات سایت» خوانده میشوند. اینجا فقط متنهای نمایشی فوتر را ویرایش کنید.
+
-
-
-
-
@@ -166,8 +165,6 @@ const form = reactive({});
const marqueeText = ref("");
const manifestoWordsText = ref("");
const footerMarqueeText = ref("");
-const footerAddressText = ref("");
-const footerSocialsText = ref("");
function splitTags(v: string) {
return v
@@ -209,8 +206,6 @@ onMounted(async () => {
if (key === "team") form.members = form.members || [];
if (key === "footer") {
footerMarqueeText.value = (form.marquee || []).join("\n");
- footerAddressText.value = (form.address || []).join("\n");
- footerSocialsText.value = (form.socials || []).join("\n");
}
ready.value = true;
});
@@ -222,10 +217,13 @@ function buildPayload() {
}
if (key === "footer") {
return {
- ...form,
+ tag: form.tag,
+ cta: form.cta,
marquee: footerMarqueeText.value.split("\n").map((s) => s.trim()).filter(Boolean),
- address: footerAddressText.value.split("\n").map((s) => s.trim()).filter(Boolean),
- socials: footerSocialsText.value.split("\n").map((s) => s.trim()).filter(Boolean),
+ email: form.email,
+ phone: form.phone,
+ address: form.address,
+ socials: form.socials,
};
}
return { ...form };
diff --git a/apps/api/src/content/content.service.ts b/apps/api/src/content/content.service.ts
index 7fea5d6..49e734f 100644
--- a/apps/api/src/content/content.service.ts
+++ b/apps/api/src/content/content.service.ts
@@ -10,7 +10,7 @@ export class ContentService {
return this.prisma.siteSettings.findUniqueOrThrow({ where: { id: "default" } });
}
- updateSettings(data: {
+ async updateSettings(data: {
brandName?: string;
tagline?: string;
email?: string;
@@ -21,7 +21,7 @@ export class ContentService {
logoUrl?: string | null;
}) {
const { logoUrl, timezone, ...rest } = data;
- return this.prisma.siteSettings.update({
+ const settings = await this.prisma.siteSettings.update({
where: { id: "default" },
data: {
...rest,
@@ -29,6 +29,32 @@ export class ContentService {
...(logoUrl !== undefined ? { logoUrl: logoUrl || null } : {}),
},
});
+
+ // Keep footer section contact fields in sync with site settings
+ const footer = await this.prisma.sectionContent.findUnique({ where: { key: "footer" } });
+ if (footer) {
+ const prev = (footer.data || {}) as Record;
+ const addressLines = settings.address
+ ? settings.address.split(/\n|,/).map((s) => s.trim()).filter(Boolean)
+ : (prev.address as string[]) || [];
+ const socials = Array.isArray(settings.socials)
+ ? (settings.socials as Array<{ label: string; url: string }>).map((s) => s.label).filter(Boolean)
+ : prev.socials;
+ await this.prisma.sectionContent.update({
+ where: { key: "footer" },
+ data: {
+ data: {
+ ...prev,
+ email: settings.email,
+ phone: settings.phone,
+ address: addressLines,
+ socials,
+ },
+ },
+ });
+ }
+
+ return settings;
}
async listSections() {
diff --git a/apps/landing/components/SiteFooter.vue b/apps/landing/components/SiteFooter.vue
index 8bfa025..e0e043f 100644
--- a/apps/landing/components/SiteFooter.vue
+++ b/apps/landing/components/SiteFooter.vue
@@ -2,45 +2,56 @@
diff --git a/apps/landing/pages/index.vue b/apps/landing/pages/index.vue
index 51f3c3c..2934b53 100644
--- a/apps/landing/pages/index.vue
+++ b/apps/landing/pages/index.vue
@@ -21,7 +21,14 @@
-
+
Unable to load site content. Is the API running?