这是indexloc提供的服务,不要输入任何密码
Skip to content

Publishing documents #387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

DennisAlund
Copy link
Member

Description:

This PR introduces Cloud Functions to handle the publishing and unpublishing of documents in the tanam-documents collection. The implementation ensures that documents are copied to a public collection (tanam-public) when published and removed from the public collection when unpublished. It also manages the copying and deletion of associated files in Cloud Storage.

Closes #382

Changes Introduced:

  1. Cloud Function: onPublishChange

    • Triggers on document write events in the tanam-documents/{documentId} collection.
    • Enqueues tasks to publish or unpublish the document based on the change in document status.
  2. Task Function: taskPublishDocument

    • Handles the publishing of documents by copying the document data to the tanam-public collection.
    • Copies associated files from the Cloud Storage path /tanam-documents/{id}/** to /tanam-public/{id}/**.
  3. Task Function: taskUnpublishDocument

    • Handles the unpublishing of documents by deleting the document data from the tanam-public collection.
    • Deletes associated files from the Cloud Storage path /tanam-public/{id}/**.

@DennisAlund DennisAlund added the platform:backend Backend / cloud functions label Jul 1, 2024
@DennisAlund DennisAlund added this to the Publishing milestone Jul 1, 2024
@DennisAlund DennisAlund self-assigned this Jul 1, 2024
@DennisAlund DennisAlund linked an issue Jul 1, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Jul 1, 2024

Visit the preview URL for this PR (updated for commit 7403166):

https://tanam-testing--pr387-issue-382-cloud-func-05fu1kpf.web.app

(expires Mon, 08 Jul 2024 14:06:01 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 5bbe8a1a68d9684d656bffba10008fe532204561

@DennisAlund DennisAlund merged commit 3059076 into milestone/3-publishing Jul 7, 2024
3 checks passed
@DennisAlund DennisAlund deleted the issue/382-cloud-function-for-publishing-documents-to-public-collection branch July 7, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:backend Backend / cloud functions
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Cloud Function for Publishing Documents to Public Collection
2 participants