Skip to content
Snippets Groups Projects
Commit 3222f344 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

provide timestamp in error data

parent 9cb5febe
No related branches found
No related tags found
2 merge requests!223reset the pin numbers before search results are fetch (so the results will be...,!199Resolve "[MIN-321] form for reporting errors in minerva"
......@@ -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;
......
......@@ -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();
});
});
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment