-
Notifications
You must be signed in to change notification settings - Fork 0
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 #54 from CityOfDetroit/issue.52
Use waste schedule API for calendar events
- Loading branch information
Showing
4 changed files
with
129 additions
and
144 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Returns the API endpoint for the City of Detroit Waste Schedule API. | ||
* @param {number} routeNum - The number denoting the waste pickup route. | ||
* @param {string} year - The year formatted as YYYY. | ||
* @param {string} month - The month formatted as MM and 1-indexed. | ||
* @returns {string} - A REST API endpoint URL. | ||
*/ | ||
function buildWasteAPI(routeNum, year, month) { | ||
return `https://apis.detroitmi.gov/waste_schedule/details/${routeNum}/year/${year}/month/${month}/`; | ||
} | ||
|
||
const PICKUP_TYPES = Object.freeze({ | ||
TRASH: "trash", | ||
RECYCLING: "recycling", | ||
BULK: "bulk", | ||
YARD_WASTE: "yard waste" | ||
}); | ||
|
||
const PICKUP_TYPES_PRINT = Object.freeze({ | ||
"trash": "Garbage", | ||
"recycling": "Recycle", | ||
"bulk": "Bulk", | ||
"yard waste": "Yard" | ||
}); | ||
|
||
export {buildWasteAPI, PICKUP_TYPES, PICKUP_TYPES_PRINT}; |