acmutd / acmutd/portal-backend

Refactor Event Check-In to query path field instead of document name

未关闭
#49 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
3
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

**Refactor Event Check-In**
Currently the Event Check-In system makes a query for a document that has the name of the checkin path. For example if someone lands on `/checkin/mycoolevent` then we search for a document called `mycoolevent` to retrieve event information from. However, this causes challenges in the future since we cannot reuse the same link for a different event. Cloud Firestore prevents us from renaming documents and so querying based on document names means we are locked into using it for just that one event.

We would instead like to search for the document that has the `path_name` value set to the checkin link. This ensures that in the future can easily adapt a link to point to a different event simply by modifying the `path_name` value. Making this change also means that when we create a new event we no longer care about what the name of the document is.

**Task List**
- [ ] Refactor query [here](https://github.com/acmutd/portal-backend/blob/c38f090406ccf98531b6e3b887e5253c119c8de2/functions/src/application/portal.ts#L56). View how to make a firestore query [here](https://firebase.google.com/docs/firestore/query-data/queries)
- [ ] Change document write [here](https://github.com/acmutd/portal-backend/blob/c38f090406ccf98531b6e3b887e5253c119c8de2/functions/src/application/portal.ts#L86). Save the document ref from the previous task to reuse here instead of making a fresh query again.
- [ ] Change document write [here](https://github.com/acmutd/portal-backend/blob/c38f090406ccf98531b6e3b887e5253c119c8de2/functions/src/custom/event.ts#L67) when creating a new event. We no longer care about the document name so use `.collection(event_collection).add()`.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。