airqo-platform / airqo-platform/AirQo-api

Refactor Common Validation Logic in Routes

Open
#3,770 0 comments 0 reactions 1 assignee Claimed by @Baalmart View on GitHub
Dominant language
JavaScript
Stars
26
Forks
24
Avg merge
5h 36m
Merged PRs (30d)
81

Description

The validation rules for query parameters like `startTime`, `endTime`, `frequency`, etc., are similar across multiple routes such as in `src/device-registry/routes/v2/readings.js`. Consider refactoring them into reusable middleware functions or validation schemas to reduce code duplication and enhance maintainability.

Referenced in PR [#3762](https://github.com/airqo-platform/AirQo-api/pull/3762) and [this comment](https://github.com/airqo-platform/AirQo-api/pull/3762#discussion_r1816402975).

Requested by @Baalmart.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.