Refactor Encounters, use new translations format for save space
This commit is contained in:
parent
7d9f58650a
commit
908f45eb9b
59 changed files with 103852 additions and 58396 deletions
23
.support/utils/callTolgee.ts
Normal file
23
.support/utils/callTolgee.ts
Normal 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;
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue