Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
1 change: 1 addition & 0 deletions functions-scrapper/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
1 change: 1 addition & 0 deletions functions/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
7 changes: 3 additions & 4 deletions server/api/instance/notes/index.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down