airqo-platform / airqo-platform/AirQo-api
Refactor 'listExpiringTokens' and 'listExpiredTokens' to reduce code duplication
未关闭
- 主要语言
- JavaScript
- 星标
- 26
- 派生
- 24
- 平均合并
- 5 小时 36 分钟
- 30 天内合并 PR
- 81
描述
As per [PR #3634](https://github.com/airqo-platform/AirQo-api/pull/3634), the methods `listExpiringTokens` and `listExpiredTokens` in `src/auth-service/utils/control-access.js` have similar structures and logic, differing mainly in the function called (`getExpiringTokens` vs. `getExpiredTokens`). It is suggested to refactor these methods into a single reusable function or higher-order function that accepts a parameter to differentiate the behavior. This will enhance maintainability and reduce redundancy.
Requester: @Baalmart
[Comment Link](https://github.com/airqo-platform/AirQo-api/pull/3634#discussion_r1797805206)
贡献指南
评估
这个 Issue 还没有评估数据。