Browse Source

Task: Added changelogs and improved code readability

pull/7247/head
Aftab3008 1 week ago
parent
commit
3220b017e1
  1. 6
      CHANGELOG.md
  2. 4
      apps/api/src/app/admin/admin.service.ts
  3. 10
      apps/api/src/app/admin/pipes/property-key.pipe.ts

6
CHANGELOG.md

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Changed
- Hardened the endpoint to update a property of the admin control panel by validating the `key` path parameter
## 3.21.0 - 2026-07-05
### Added

4
apps/api/src/app/admin/admin.service.ts

@ -349,8 +349,8 @@ export class AdminService {
if (value) {
response = await this.propertyService.put({
value,
key
key,
value
});
} else {
response = await this.propertyService.delete({

10
apps/api/src/app/admin/pipes/property-key.pipe.ts

@ -8,10 +8,14 @@ export class PropertyKeyPipe implements PipeTransform<string, PropertyKey> {
private readonly allowedKeys: Set<string>;
public constructor() {
this.allowedKeys = new Set(
this.allowedKeys = new Set<string>(
Object.entries(config)
.filter(([key]) => key.startsWith('PROPERTY_'))
.map(([, value]) => value as string)
.filter(([key]) => {
return key.startsWith('PROPERTY_');
})
.map(([, value]) => {
return value as string;
})
);
}

Loading…
Cancel
Save