refactor(clickTtPlayerRegistrationService): update debug HTML file path generation

- Modified the buildDebugHtmlPath function to use path.join for constructing the file path, ensuring compatibility across different operating systems.
- This change enhances the maintainability of the code by standardizing file path handling.
This commit is contained in:
Torsten Schulz (local)
2026-03-11 16:42:23 +01:00
parent c0efd56c9c
commit a77926838b

View File

@@ -1,5 +1,6 @@
import { chromium } from 'playwright';
import { writeFile } from 'fs/promises';
import path from 'path';
import Member from '../models/Member.js';
import Club from '../models/Club.js';
import ClickTtAccount from '../models/ClickTtAccount.js';
@@ -38,7 +39,7 @@ function escapeRegExp(value) {
function buildDebugHtmlPath() {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
return `/tmp/clicktt-debug-${timestamp}.html`;
return path.join(process.cwd(), 'backend', 'tmp', `clicktt-debug-${timestamp}.html`);
}
class ClickTtPlayerRegistrationService {