forked from UKSOURCE/cms.hailearning.edu.vn
refactor: restructure home model and update homeController
This commit is contained in:
@@ -21,17 +21,17 @@ const migrateHeader = async () => {
|
||||
// Transform and insert data
|
||||
const headerDocument = {
|
||||
top: {
|
||||
phone: headerData.top.phone,
|
||||
email: headerData.top.email,
|
||||
location: headerData.top.location,
|
||||
socialLinks: headerData.top.socialLinks.map((link, idx) => ({
|
||||
phone: headerData.top?.phone || "",
|
||||
email: headerData.top?.email || "",
|
||||
location: headerData.top?.location || "",
|
||||
socialLinks: (headerData.top?.socialLinks || []).map((link, idx) => ({
|
||||
...link,
|
||||
order: idx,
|
||||
})),
|
||||
languages: headerData.top.languages,
|
||||
languages: headerData.top?.languages || [],
|
||||
},
|
||||
offcanvas: headerData.offcanvas,
|
||||
menu: headerData.menu.map((item, idx) => ({
|
||||
offcanvas: headerData.offcanvas || {},
|
||||
menu: (headerData.menu || []).map((item, idx) => ({
|
||||
...item,
|
||||
order: idx,
|
||||
children:
|
||||
|
||||
Reference in New Issue
Block a user