Skip to content

Commit

Permalink
update url
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhou121 committed Nov 24, 2022
1 parent e45f2d7 commit 2a87988
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions volts-back/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ where
pub async fn yank(
TypedHeader(token): TypedHeader<headers::Authorization<Bearer>>,
State(db_pool): State<DbPool>,
Path((author, name, version)): Path<(String, String, String)>,
Path((name, version)): Path<(String, String)>,
) -> impl IntoResponse {
let api_token = {
let mut conn = db_pool.write.get().await.unwrap();
Expand All @@ -677,7 +677,7 @@ pub async fn yank(
pub async fn unyank(
TypedHeader(token): TypedHeader<headers::Authorization<Bearer>>,
State(db_pool): State<DbPool>,
Path((author, name, version)): Path<(String, String, String)>,
Path((name, version)): Path<(String, String)>,
) -> impl IntoResponse {
let api_token = {
let mut conn = db_pool.write.get().await.unwrap();
Expand Down
4 changes: 2 additions & 2 deletions volts-back/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ pub fn build_router() -> Router<AppState> {
let plugins_routes = Router::with_state(state.clone())
.route("/", get(plugin::search))
.route("/new", put(plugin::publish))
.route("/:author/:name/:version/yank", post(plugin::yank))
.route("/:author/:name/:version/unyank", post(plugin::unyank))
.route("/me/:name/:version/yank", put(plugin::yank))
.route("/me/:name/:version/unyank", put(plugin::unyank))
.route("/:author/:name/:version", get(plugin::meta))
.route("/:author/:name/:version/download", get(plugin::download))
.route("/:author/:name/:version/readme", get(plugin::readme))
Expand Down
6 changes: 3 additions & 3 deletions volts-cli/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub(crate) fn publish(cli: &Cli) {
}

let resp = reqwest::blocking::Client::new()
.request(Method::PUT, "http://127.0.0.1:8080/api/v1/plugins/new")
.request(Method::PUT, "https://plugins.lapce.dev/api/v1/plugins/new")
.bearer_auth(token.trim())
.body(File::open(&archive_path).unwrap())
.send()
Expand All @@ -143,7 +143,7 @@ pub(crate) fn yank(cli: &Cli, name: &String, version: &String) {
let resp = reqwest::blocking::Client::new()
.request(
Method::PUT,
format!("https://plugins.lapce.dev/api/v1/me/plugins/{name}/{version}/yank"),
format!("https://plugins.lapce.dev/api/v1/plugins/me/{name}/{version}/yank"),
)
.bearer_auth(token.trim())
.send()
Expand All @@ -161,7 +161,7 @@ pub(crate) fn unyank(cli: &Cli, name: &String, version: &String) {
let resp = reqwest::blocking::Client::new()
.request(
Method::PUT,
format!("https://plugins.lapce.dev/api/v1/me/plugins/{name}/{version}/unyank"),
format!("https://plugins.lapce.dev/api/v1/plugins/me/{name}/{version}/unyank"),
)
.bearer_auth(token.trim())
.send()
Expand Down

0 comments on commit 2a87988

Please sign in to comment.