Skip to content

Commit

Permalink
Fix findUnitByCode()
Browse files Browse the repository at this point in the history
  • Loading branch information
williambelle committed May 31, 2024
1 parent 5e8c947 commit 27171f1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ const buildUnitUrl = (unit, language) => {
return UNITS_URL + '?q=' + unit + '&hl=' + language;
};

const buildCodeUrl = (code, language) => {
return UNITS_URL + '?acro=' + code + '&hl=' + language;
};

const findUnitByName = (unit, language = 'en') => {
const url = buildUnitUrl(unit, language);
return getUnit(url);
};

const findUnitByCode = (code, language = 'en') => {
const url = buildCodeUrl(code, language);
const url = buildUnitUrl(code, language);
return getUnit(url);
};

Expand Down

0 comments on commit 27171f1

Please sign in to comment.