Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
452eedc
fix: resolve TypeScript errors from Exercise/Activity i18n type changes"
FalkenDev May 17, 2026
f5ed306
fix: downgrade prettier-eslint to version 16.3.0 for compatibility
FalkenDev May 18, 2026
3ff2fa7
fix: remove deprecated route '/WorkoutDetailsOld' from typed-router
FalkenDev May 18, 2026
7892dc4
feat: now showing more workouts and some redesign
FalkenDev May 18, 2026
da4ff29
feat: add new localization strings for English and Swedish
FalkenDev May 18, 2026
6b2f50b
feat: enhance ProgressBar with streak information and improved styling
FalkenDev May 18, 2026
0911545
refactor: simplify layout and improve streak display in index.vue
FalkenDev May 18, 2026
285827e
feat: add new localization strings and update index.vue for training …
FalkenDev May 19, 2026
895aca2
feat: add localization strings for streak protection and update Calen…
FalkenDev May 19, 2026
444bd59
feat: enhance Calendar.vue with improved empty state handling and but…
FalkenDev May 19, 2026
4a46732
feat: add 'Your Training' localization and update Statistics.vue for …
FalkenDev May 19, 2026
5dd47d1
fix: correct punctuation in localization strings for improved readabi…
FalkenDev Jun 15, 2026
fad67c5
fix: update freeze count logic in Calendar.vue for accurate display
FalkenDev Jun 15, 2026
2523500
feat: implement streak decrement on deletion of finished sessions and…
FalkenDev Jun 15, 2026
5ea259e
fix: ensure 'role' column is added only if it does not exist in the u…
FalkenDev Jun 15, 2026
1cf68c4
fix: enhance tab styling in Statistics.vue for improved UI consistency
FalkenDev Jun 15, 2026
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
4,059 changes: 339 additions & 3,720 deletions backend/package-lock.json

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"install": "^0.13.0",
"jszip": "^3.10.1",
"multer": "^2.1.1",
"npm": "^11.14.1",
"passport": "^0.7.0",
"passport-github2": "^0.1.12",
"passport-google-oauth20": "^2.0.0",
Expand All @@ -59,14 +58,14 @@
"typeorm": "^0.3.25"
},
"devDependencies": {
"@nestjs/cli": "^11.0.21",
"@nestjs/cli": "^11.0.0",
"@nestjs/schematics": "^11.1.0",
"@nestjs/testing": "^11.1.21",
"@types/bcrypt": "^5.0.2",
"@types/cookie-parser": "^1.4.9",
"@types/express": "^5.0.0",
"@types/jest": "^29.5.2",
"@types/node": "^20.3.1",
"@types/node": "^22.0.0",
"@types/passport-jwt": "^4.0.1",
"@types/passport-local": "^1.0.38",
"@types/supertest": "^6.0.0",
Expand Down Expand Up @@ -103,7 +102,6 @@
"testEnvironment": "node"
},
"overrides": {
"@nestjs/mapped-types": "2.0.6",
"fast-uri": "^3.1.2",
"path-to-regexp": "^8.4.0",
"picomatch": "^4.0.4",
Expand Down
1 change: 1 addition & 0 deletions backend/src/v1/activityLog/activityLog.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ export class ActivityLogService {
}

await this.activityLogRepo.remove(log);
await this.userService.decrementStreakOnDeletion(userId);
}

async update(
Expand Down
21 changes: 12 additions & 9 deletions backend/src/v1/migrations/1776000000000-AddRoleToUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';

export class AddRoleToUser1776000000000 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.addColumn(
'user',
new TableColumn({
name: 'role',
type: 'varchar',
length: '20',
default: "'user'",
}),
);
const table = await queryRunner.getTable('user');
if (!table?.findColumnByName('role')) {
await queryRunner.addColumn(
'user',
new TableColumn({
name: 'role',
type: 'varchar',
length: '20',
default: "'user'",
}),
);
}
}

public async down(queryRunner: QueryRunner): Promise<void> {
Expand Down
13 changes: 13 additions & 0 deletions backend/src/v1/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ export class UserService {
const sessions = await this.sessionRepo.find({
where: {
user: { id: userId },
status: 'finished',
},
select: ['startedAt'],
});
Expand Down Expand Up @@ -358,6 +359,18 @@ export class UserService {
return count;
}

/**
* Decrement streak when a finished session or activity log is deleted
*/
async decrementStreakOnDeletion(userId: number): Promise<void> {
const user = await this.userRepo.findOne({ where: { id: userId } });
if (!user) return;
if (user.currentStreak > 0) {
user.currentStreak -= 1;
}
await this.userRepo.save(user);
}

/**
* Update streak and weekly workout count when an activity log is created
* Should be called after logging an activity
Expand Down
4 changes: 4 additions & 0 deletions backend/src/v1/workoutSession/workoutSession.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,11 @@ export class WorkoutSessionService {

if (!session) throw new NotFoundException('Session not found');

const wasFinished = session.status === 'finished';
await this.sessionRepo.remove(session);
if (wasFinished) {
await this.userService.decrementStreakOnDeletion(userId);
}
return { message: 'Workout session deleted' };
}

Expand Down
Loading
Loading