Skip to content

Commit

Permalink
remove term search from api, cleanup envs
Browse files Browse the repository at this point in the history
  • Loading branch information
KjartanE committed Jan 30, 2024
1 parent fcc2c61 commit 5d2ebea
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 238 deletions.
6 changes: 0 additions & 6 deletions .vscode/settings.json

This file was deleted.

97 changes: 0 additions & 97 deletions api/src/paths/taxonomy/itis/search.test.ts

This file was deleted.

93 changes: 0 additions & 93 deletions api/src/paths/taxonomy/itis/search.ts

This file was deleted.

17 changes: 0 additions & 17 deletions api/src/services/es-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,6 @@ export class ESService {
});
}

/**
* Returns the ITIS search URL.
*
* @param {string} searchParams
* @return {*} {Promise<string>}
* @memberof ESService
*/
async getItisTermSearchUrl(searchParams: string): Promise<string> {
const itisUrl = process.env.ITIS_URL;
if (!itisUrl) {
throw new Error('ITIS_SEARCH_URL not defined.');
}
const itisSearchSpecies = this._getItisSearchSpeciesQuery(searchParams);

return `${itisUrl}?${ITIS_PARAMS.SORT}&${itisSearchSpecies}&${ITIS_PARAMS.FILTER}`;
}

/**
* Returns the ITIS search URL for TSN ids.
*
Expand Down
23 changes: 0 additions & 23 deletions api/src/services/taxonomy-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,6 @@ export interface IItisSearchResult {
* @extends {ESService}
*/
export class TaxonomyService extends ESService {
/**
* Returns the ITIS search species Query.
*
* @param {*} searchRequest
* @return {*} {(Promise<IItisSearchResult[] | undefined>)}
* @memberof TaxonomyService
*/
async itisTermSearch(searchRequest: string): Promise<IItisSearchResult[] | undefined> {
try {
const itisClient = await this.getItisTermSearchUrl(searchRequest);

const response = await axios.get(itisClient);

if (!response.data || !response.data.response || !response.data.response.docs) {
return [];
}

return this._sanitizeItisData(response.data.response.docs);
} catch (error) {
defaultLog.debug({ label: 'itisTermSearch', message: 'error', error });
}
}

/**
* Returns the ITIS search by TSN.
*
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
- ELASTICSEARCH_EML_INDEX=${ELASTICSEARCH_EML_INDEX}
- ELASTICSEARCH_TAXONOMY_INDEX=${ELASTICSEARCH_TAXONOMY_INDEX}
# ITIS API
- ITIS_URL=${ITIS_URL}
- ITIS_SOLR_URL=${ITIS_SOLR_URL}
- S3_KEY_PREFIX=${S3_KEY_PREFIX}
- TZ=${API_TZ}
- API_HOST=${API_HOST}
Expand Down Expand Up @@ -175,6 +175,7 @@ services:
- REACT_APP_KEYCLOAK_HOST=${KEYCLOAK_HOST}
- REACT_APP_KEYCLOAK_REALM=${KEYCLOAK_REALM}
- REACT_APP_KEYCLOAK_CLIENT_ID=${KEYCLOAK_CLIENT_ID}
- REACT_APP_ITIS_SOLR_URL=${ITIS_SOLR_URL}
volumes:
- ./app:/opt/app-root/src
- /opt/app-root/src/node_modules # prevents local node_modules overriding container node_modules
Expand Down
2 changes: 1 addition & 1 deletion env_config/env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ ELASTICSEARCH_TAXONOMY_INDEX=taxonomy_3.0.0
# ------------------------------------------------------------------------------
# ITIS Platform API
# ------------------------------------------------------------------------------
ITIS_URL=https://services.itis.gov/
ITIS_SOLR_URL=https://services.itis.gov/

# ------------------------------------------------------------------------------
# GeoServer - https://geoserver.org/
Expand Down

0 comments on commit 5d2ebea

Please sign in to comment.