-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from p2p-org/new-aggregated-distributors-query
New aggregated distributors query
- Loading branch information
Showing
35 changed files
with
534 additions
and
508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import axios from "axios"; | ||
import {logger} from "./helpers/logger"; | ||
import {FdWithPeriodFromApi} from "./models/FdWithPeriodFromApi"; | ||
|
||
export async function getFdAddressesWithPeriodsFromApi() : Promise<Record<string, FdWithPeriodFromApi[]>> { | ||
logger.info('getFdAddressesWithPeriodsFromApi started') | ||
|
||
if (!process.env.DISTRIBUTORS_URL) { | ||
throw new Error("No DISTRIBUTORS_URL in ENV") | ||
} | ||
|
||
const result = await axios.get(process.env.DISTRIBUTORS_URL!) | ||
|
||
const array = result.data as Record<string, FdWithPeriodFromApi[]> | ||
|
||
logger.info('getFdAddressesWithPeriodsFromApi finished') | ||
return array | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.