mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-22 03:56:49 +03:00
chore(SlateLayout): remove layouts from other endpoints
This commit is contained in:
parent
3ff94ca857
commit
d6a7265208
@ -34,7 +34,6 @@ export const sanitizeSlate = (entity) => {
|
||||
name: entity.data?.name,
|
||||
body: entity.data?.body,
|
||||
preview: entity.data?.preview,
|
||||
layouts: entity.data?.layouts,
|
||||
tags: entity.data?.tags,
|
||||
},
|
||||
fileCount: entity.fileCount,
|
||||
@ -110,7 +109,6 @@ export const cleanSlate = (entity) => {
|
||||
// name: entity.data?.name,
|
||||
// body: entity.data?.body,
|
||||
// preview: entity.data?.preview,
|
||||
// layouts: entity.data?.layouts,
|
||||
// tags: entity.data?.tags,
|
||||
// },
|
||||
};
|
||||
|
@ -55,7 +55,6 @@ export default async (req, res) => {
|
||||
public: slate.isPublic,
|
||||
objects: reformattedObjects,
|
||||
ownerId: slate.ownerId,
|
||||
layouts: slate.data.layouts,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -60,7 +60,6 @@ export default async (req, res) => {
|
||||
public: slate.isPublic,
|
||||
objects: reformattedObjects,
|
||||
ownerId: slate.ownerId,
|
||||
layouts: slate.data.layouts,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
@ -534,26 +534,14 @@ const cleanUsersTable = async () => {
|
||||
const cleanSlatesTable = async () => {
|
||||
const slates = await DB.select("*").from("slates");
|
||||
for (let slate of slates) {
|
||||
const id = slate.id;
|
||||
let layouts = slate.data.layouts;
|
||||
if (layouts && layouts.ver === "2.0" && layouts.layout) {
|
||||
for (let position of layouts.layout) {
|
||||
if (position.id) {
|
||||
position.id = position.id.replace("data-", "");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
layouts = null;
|
||||
}
|
||||
let data = {
|
||||
layouts,
|
||||
body: slate.data.body,
|
||||
name: slate.data.name,
|
||||
preview: slate.data.preview,
|
||||
tags: slate.data.tags,
|
||||
};
|
||||
// Logging.log(layouts?.layout);
|
||||
// Logging.log(data);
|
||||
|
||||
const { id } = slate;
|
||||
await DB.from("slates").where("id", id).update({ data });
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user