You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
spa_instat_tv/src/requests/getLexics.tsx

30 lines
608 B

import { DATA_URL, PROCEDURES } from 'config'
import { callApi, getResponseData } from 'helpers'
const proc = PROCEDURES.param_lexical
export type Translation = {
id: string,
lang: string,
lexis_lang_id: string,
text: string,
}
export type Translations = {[id: string]: Translation}
export const getLexics = (lang: string, lexicIds: Array<number>): Promise<Translations> => {
const config = {
body: {
params: {
_p_lang: lang,
_p_param_arr: lexicIds,
},
proc,
},
}
return callApi({
config,
url: DATA_URL,
}).then(getResponseData(proc))
}