From af104d9f1b9bc690de9cf77aea5cc5a8070bbf0c Mon Sep 17 00:00:00 2001 From: Victor Saa Date: Mon, 29 Jun 2026 22:51:43 -0500 Subject: [PATCH 1/2] Update deploy pipeline command --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7aa1586..1a4d1bb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -63,7 +63,7 @@ jobs: - name: "Deploy to Firebase" uses: w9jds/firebase-action@master with: - args: deploy --only functions + args: deploy --only functions,firestore --force env: GCP_SA_KEY: ${{ secrets.F_PRIVATE_KEY }} PROJECT_ID: ${{ vars.F_PROJECT_ID }} From 7edd503df0759ac90230a7b801941a45e334103a Mon Sep 17 00:00:00 2001 From: Victor Saa Date: Mon, 29 Jun 2026 23:06:44 -0500 Subject: [PATCH 2/2] fix linked query usage --- functions-scrapper/.npmrc | 1 + functions/.npmrc | 1 + server/api/instance/notes/index.post.ts | 7 +++---- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 functions-scrapper/.npmrc create mode 100644 functions/.npmrc diff --git a/functions-scrapper/.npmrc b/functions-scrapper/.npmrc new file mode 100644 index 0000000..e9ee3cb --- /dev/null +++ b/functions-scrapper/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps=true \ No newline at end of file diff --git a/functions/.npmrc b/functions/.npmrc new file mode 100644 index 0000000..e9ee3cb --- /dev/null +++ b/functions/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps=true \ No newline at end of file diff --git a/server/api/instance/notes/index.post.ts b/server/api/instance/notes/index.post.ts index 519864f..233d475 100644 --- a/server/api/instance/notes/index.post.ts +++ b/server/api/instance/notes/index.post.ts @@ -71,15 +71,14 @@ export default defineConditionallyCachedEventHandler(async (event) => { // Public notes only query = query.where("public", "==", true); + // Linked notes can only be public if (linkedNoteSlug) { // Same as /api/instance/notes/[noteSlug].post - const notesSnapshot = await firebaseFirestore - .collectionGroup("notes") - .where("instanceRef", "==", currentInstanceRef) + const linkedNotesSnapshot = await query .where("slug", "==", linkedNoteSlug) .limit(1) .get(); - const [snapshot] = notesSnapshot.docs; + const [snapshot] = linkedNotesSnapshot.docs; // Check if linked note exists if (!snapshot?.exists) {