Add page data delivery and publication guards
This commit is contained in:
+8
-4
@@ -670,9 +670,13 @@ export function createPageService(pool, options = {}) {
|
||||
AND JSON_UNQUOTE(JSON_EXTRACT(pv.source_snapshot_json, '$.relative_path')) = ?
|
||||
)
|
||||
)
|
||||
ORDER BY p.updated_at DESC, p.id DESC
|
||||
ORDER BY
|
||||
CASE WHEN p.workspace_relative_path = ? THEN 0 ELSE 1 END,
|
||||
CASE WHEN pr.id IS NOT NULL THEN 0 ELSE 1 END,
|
||||
p.updated_at DESC,
|
||||
p.id DESC
|
||||
LIMIT 1`,
|
||||
[userId, normalized, normalized],
|
||||
[userId, normalized, normalized, normalized],
|
||||
);
|
||||
return rows[0] ? pageResponse(rows[0]) : null;
|
||||
};
|
||||
@@ -1481,8 +1485,8 @@ export function createPageService(pool, options = {}) {
|
||||
},
|
||||
}),
|
||||
createPage: (userId, input) => createVersion(userId, input, { type: 'template' }),
|
||||
updatePage: (userId, pageId, input) =>
|
||||
createVersion(userId, { ...input, pageId }, { type: 'generated' }),
|
||||
updatePage: (userId, pageId, input, source = {}) =>
|
||||
createVersion(userId, { ...input, pageId }, { type: 'generated', ...source }),
|
||||
localizePrivateResources,
|
||||
redactPage,
|
||||
createRedactedCopy: redactPage,
|
||||
|
||||
Reference in New Issue
Block a user