aboutsummaryrefslogtreecommitdiff
path: root/src/api/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/mod.rs')
-rw-r--r--src/api/mod.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/api/mod.rs b/src/api/mod.rs
index ffed5ea..c4aa1f7 100644
--- a/src/api/mod.rs
+++ b/src/api/mod.rs
@@ -113,7 +113,9 @@ impl Api {
/// Combines the given endpoint with the `base_url` of this API.
fn make_url(&self, endpoint: &str) -> Url {
- self.base_url.join(endpoint).expect("Invalid API endpoint")
+ let mut result = self.base_url.join(endpoint).expect("Invalid API endpoint");
+ result.set_query(Some("v=2019-19-12T0:00"));
+ result
}
/// Get and deserialize a cached value.
@@ -208,6 +210,14 @@ impl Api {
self.get_multiple_cached("professions", "professions/", ids)
}
+ /// Retrieve all available professions.
+ ///
+ /// This is a shortcut around `get_profession_ids` and `get_professions`.
+ pub fn get_all_professions(&mut self) -> Result<Vec<Profession>, ApiError> {
+ let ids = self.get_profession_ids()?;
+ self.get_professions(&ids)
+ }
+
/// Retrieve detailed information about the given skills.
///
/// Skills that are found in the cache are taken from there.