mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-11 04:36:24 +00:00
Remove unused ids
query parameter from GET /extensions
endpoint (#13802)
This PR removes the `ids` query parameter from the `GET /extensions` endpoint, as we don't use it. We originally added the query parameter in #9929 to facilitate auto-updates. However, it was superseded by the `GET /extensions/updates` endpoint in #10052. There shouldn't be any Zed versions out in the wild that are using the `ids` query parameter, as we added the endpoint on Thursday, March 28, and replaced its usage with the new endpoint on Monday, April 1, before the next Zed release. Release Notes: - N/A
This commit is contained in:
parent
8ec478cbcd
commit
52583fe1ed
1 changed files with 8 additions and 21 deletions
|
@ -36,8 +36,6 @@ pub fn router() -> Router {
|
|||
struct GetExtensionsParams {
|
||||
filter: Option<String>,
|
||||
#[serde(default)]
|
||||
ids: Option<String>,
|
||||
#[serde(default)]
|
||||
max_schema_version: i32,
|
||||
}
|
||||
|
||||
|
@ -45,27 +43,16 @@ async fn get_extensions(
|
|||
Extension(app): Extension<Arc<AppState>>,
|
||||
Query(params): Query<GetExtensionsParams>,
|
||||
) -> Result<Json<GetExtensionsResponse>> {
|
||||
let extension_ids = params
|
||||
.ids
|
||||
.as_ref()
|
||||
.map(|s| s.split(',').map(|s| s.trim()).collect::<Vec<_>>());
|
||||
|
||||
let extensions = if let Some(extension_ids) = extension_ids {
|
||||
app.db.get_extensions_by_ids(&extension_ids, None).await?
|
||||
} else {
|
||||
let result = app
|
||||
let extensions = app
|
||||
.db
|
||||
.get_extensions(params.filter.as_deref(), params.max_schema_version, 500)
|
||||
.await?;
|
||||
|
||||
if let Some(query) = params.filter.as_deref() {
|
||||
let count = result.len();
|
||||
let count = extensions.len();
|
||||
tracing::info!(query, count, "extension_search")
|
||||
}
|
||||
|
||||
result
|
||||
};
|
||||
|
||||
Ok(Json(GetExtensionsResponse { data: extensions }))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue