Refactor Encounters, use new translations format for save space

This commit is contained in:
Roman Jaroš 2025-04-17 19:04:49 +02:00
parent 7d9f58650a
commit 908f45eb9b
59 changed files with 103852 additions and 58396 deletions

View file

@ -0,0 +1,23 @@
import axios from 'axios';
export const callTolgee = async <R>(
method: 'GET' | 'POST' | 'PUT' | 'DELETE' = 'GET',
path: string,
params?: any,
data?: any,
) => {
const args = process.argv.slice(2);
const projectId = args[1];
try {
return await axios<R>(`https://translate.romanjaros.local/v2/projects/${projectId}${path}`, {
method,
data,
params,
headers: {
'X-API-KEY': process.env.TOLGEE_PAT as string,
},
});
} catch (e) {
throw e;
}
};