From 97ee4d3bda2fc696c65d8a373f531180d935ae25 Mon Sep 17 00:00:00 2001 From: "Sasha.Marchuk" Date: Mon, 30 Mar 2026 21:48:12 +0700 Subject: [PATCH] fix(global): add project builder to primaryNav _page relationship Prevents full page documents (including form configs and internal emails) from leaking through the nav API endpoint. Matches the projection already used by linkSchema for footerLinks and socialMediaLinks. Reduces /api/v1/@apostrophecms/global/nav response from ~159 KB to ~3 KB. Co-Authored-By: Claude Opus 4.6 (1M context) --- website/modules/@apostrophecms/global/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/website/modules/@apostrophecms/global/index.js b/website/modules/@apostrophecms/global/index.js index 8a58fd97..9f9146e8 100644 --- a/website/modules/@apostrophecms/global/index.js +++ b/website/modules/@apostrophecms/global/index.js @@ -52,6 +52,12 @@ module.exports = { withType: '@apostrophecms/page', max: 1, required: true, + builders: { + project: { + title: 1, + _url: 1, + }, + }, if: { linkType: 'page', },