Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Add application version to admin endpoint (#2423)

Siddharth Singhd9a6c22e1e90
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 697f516015..49419da3ca 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,12 +5,18 @@ 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
+
+### Added
+
+- Added the application version to the endpoint `GET api/v1/admin`
+
## 2.8.0 - 2023-10-03
### Added
- Supported enter key press to submit the form of the create or update account dialog
-- Added the version to the admin control panel
+- Added the application version to the admin control panel
- Added pagination parameters (`skip`, `take`) to the endpoint `GET api/v1/order`
### Changed
diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts
index a45fbe6344..dd9e3f9ceb 100644
--- a/apps/api/src/app/admin/admin.service.ts
+++ b/apps/api/src/app/admin/admin.service.ts
@@ -1,4 +1,5 @@
import { SubscriptionService } from '@ghostfolio/api/app/subscription/subscription.service';
+import { environment } from '@ghostfolio/api/environments/environment';
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
import { DataProviderService } from '@ghostfolio/api/services/data-provider/data-provider.service';
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service';
@@ -97,7 +98,8 @@ export class AdminService {
settings: await this.propertyService.get(),
transactionCount: await this.prismaService.order.count(),
userCount: await this.prismaService.user.count(),
- users: await this.getUsersWithAnalytics()
+ users: await this.getUsersWithAnalytics(),
+ version: environment.version
};
}
diff --git a/libs/common/src/lib/interfaces/admin-data.interface.ts b/libs/common/src/lib/interfaces/admin-data.interface.ts
index b666763465..68e1cbca47 100644
--- a/libs/common/src/lib/interfaces/admin-data.interface.ts
+++ b/libs/common/src/lib/interfaces/admin-data.interface.ts
@@ -12,4 +12,5 @@ export interface AdminData {
lastActivity: Date;
transactionCount: number;
}[];
+ version: string;
}