Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from ghostfolio:main #501

Merged
merged 1 commit into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Extended the export functionality by the tags
- Extended the user endpoint `GET api/v1/user` by the activities count

### Changed

Expand Down
9 changes: 7 additions & 2 deletions apps/api/src/app/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ export class UserService {
orderBy: { alias: 'asc' },
where: { GranteeUser: { id } }
}),
this.prismaService.order.count({
where: { userId: id }
}),
this.prismaService.order.findFirst({
orderBy: {
date: 'asc'
Expand All @@ -96,8 +99,9 @@ export class UserService {
]);

const access = userData[0];
const firstActivity = userData[1];
let tags = userData[2];
const activitiesCount = userData[1];
const firstActivity = userData[2];
let tags = userData[3];

let systemMessage: SystemMessage;

Expand All @@ -117,6 +121,7 @@ export class UserService {
}

return {
activitiesCount,
id,
permissions,
subscription,
Expand Down
1 change: 1 addition & 0 deletions libs/common/src/lib/interfaces/user.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { UserSettings } from './user-settings.interface';
export interface User {
access: Pick<Access, 'alias' | 'id' | 'permissions'>[];
accounts: Account[];
activitiesCount: number;
dateOfFirstActivity: Date;
id: string;
permissions: string[];
Expand Down
Loading