openreplay/frontend/app/services/ErrorService.ts
Andrey Babushkin fd5c0c9747
Add lokalisation (#3092)
* applied eslint

* add locales and lint the project

* removed error boundary

* updated locales

* fix min files

* fix locales
2025-03-06 17:43:15 +01:00

37 lines
975 B
TypeScript

import { IErrorStack } from 'Types/session/errorStack';
import BaseService from './BaseService';
export default class ErrorService extends BaseService {
fetchError = async (id: string) => {
const r = await this.client.get(`/errors/${id}`);
return await r.json();
};
fetchErrorList = async (params: Record<string, any>) => {
const r = await this.client.post('/errors/search', params);
return await r.json();
};
fetchErrorTrace = async (
id: string,
): Promise<{ trace: IErrorStack[]; sourcemapUploaded: boolean }> => {
const r = await this.client.get(`/errors/${id}/sourcemaps`);
const { data } = await r.json();
return data;
};
fetchNewErrorsCount = async (params: any) => {
const r = await this.client.get('/errors/stats', params);
return await r.json();
};
fetchErrorStats = async (errorId: string) => {
const r = await this.client.get(`/errors/${errorId}/stats`);
return await r.json();
};
}