diff --git a/src/utils/error-report/ErrorData.ts b/src/utils/error-report/ErrorData.ts index ba1abdded66753878d048fcc5efdb760a3cbd646..64ef0f630a0b951f1698ae209f2a642b899d293a 100644 --- a/src/utils/error-report/ErrorData.ts +++ b/src/utils/error-report/ErrorData.ts @@ -3,7 +3,7 @@ export type ErrorData = { login: string | null; email: string | null; browser: string | null; - timestamp: string | null; + timestamp: number | null; version: string | null; comment: string | null; stacktrace: string; diff --git a/src/utils/error-report/errorReporting.test.ts b/src/utils/error-report/errorReporting.test.ts index c90ef65c40f79bc454ce26cf7962f17368383c01..7adb535cb981b556de7d5539dada91c984291d88 100644 --- a/src/utils/error-report/errorReporting.test.ts +++ b/src/utils/error-report/errorReporting.test.ts @@ -47,4 +47,9 @@ describe('createErrorData', () => { expect(error.login).not.toBe('anonymous'); expect(error.login).toBe(loginFixture.login); }); + + it('should add timestamp', () => { + const error = createErrorData(new Error()); + expect(error.timestamp).not.toBeNull(); + }); }); diff --git a/src/utils/error-report/errorReporting.ts b/src/utils/error-report/errorReporting.ts index 348769f5a86e5da8605caf63e1b76421e5514b90..5d867950e82a75f477a66e147f708347fe210b25 100644 --- a/src/utils/error-report/errorReporting.ts +++ b/src/utils/error-report/errorReporting.ts @@ -23,7 +23,8 @@ export const createErrorData = (error: Error | SerializedError | undefined): Err email: null, // TODO javaStacktrace: null, // TODO stacktrace, - timestamp: null, // TODO + // eslint-disable-next-line no-magic-numbers + timestamp: Math.floor(+new Date() / 1000), version: null, // TODO }; return errorData;