airqo-platform / airqo-platform/AirQo-api

Refactor: Avoid direct mutation of req.query in notification preferences controller

Offen
#4,209 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @Baalmart Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
26
Forks
24
Ø Merge
5 Std. 36 Min.
Gemergte PRs (30 T.)
81

Beschreibung

## Context
The notification preferences controller currently mutates req.query directly which can lead to unintended side effects.

## Details
- File: src/auth-service/controllers/notification-preferences.controller.js
- Current implementation modifies req.query.tenant directly
- This can affect other middleware or handlers using the same request object

## Proposed Solution
Create a copy of the request object with the default tenant value instead of mutating the original.

## References
- PR: https://github.com/airqo-platform/AirQo-api/pull/4204
- Discussion: https://github.com/airqo-platform/AirQo-api/pull/4204#discussion_r1921239194

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.