airqo-platform / airqo-platform/AirQo-api

Refactor 'listExpiringTokens' and 'listExpiredTokens' to reduce code duplication

未关闭
#3,641 0 条评论 0 个 reaction 已指派 1 人 已被 @Baalmart 认领 在 GitHub 查看
主要语言
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 还没有评估数据。

把新 issue 发到你的邮箱

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