Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async globalsymbolsPictogramsSearch(locale, searchText) {
let language = 'eng';
if (locale.length === 3) {
language = locale;
}
if (locale.length === 2) {
language = alpha2ToAlpha3T(locale);
}
const pictogSearchTextPath = `${GLOBALSYMBOLS_BASE_PATH_API}labels/search/?query=${searchText}&language=${language}&language_iso_format=639-3&limit=20`;
try {
const { status, data } = await this.axiosInstance.get(
pictogSearchTextPath
);
if (status === 200) return data;
return [];
} catch (err) {
return [];
}
}