Skip to content

Commit 0f5468b

Browse files
committed
-fix: trigger query params
1 parent d575325 commit 0f5468b

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

fplus-http-server/src/middleware/verifier_auth.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ use actix_web::{
5555
let query: Result<web::Query<RepoQuery>, _> = web::Query::from_query(query_string);
5656
let RepoQuery { owner, repo, github_username } = match query {
5757
Ok(q) => q.into_inner(),
58-
Err(_) => {
58+
Err(e) => {
59+
println!("{}", e);
5960
return Box::pin(async {
6061
return Err(actix_web::error::ErrorBadRequest("Wrong query string format"));
6162
});

fplus-http-server/src/router/application.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use actix_web::{get, post, web, HttpResponse, Responder};
22
use fplus_lib::core::{
3-
application::file::VerifierInput, ApplicationQueryParams, CompleteGovernanceReviewInfo, CompleteNewApplicationProposalInfo, CreateApplicationInfo, DcReachedInfo, GithubQueryParams, LDNApplication, RefillInfo, ValidationPullRequestData, VerifierActionsQueryParams
3+
application::file::VerifierInput, ApplicationQueryParams, CompleteNewApplicationProposalInfo, CreateApplicationInfo, DcReachedInfo, GithubQueryParams, LDNApplication, RefillInfo, ValidationPullRequestData, VerifierActionsQueryParams
44
};
55

66
#[post("/application")]
@@ -28,10 +28,8 @@ pub async fn single(query: web::Query<ApplicationQueryParams>) -> impl Responder
2828

2929
#[post("/application/trigger")]
3030
pub async fn trigger(
31-
query: web::Query<ApplicationQueryParams>,
32-
info: web::Json<CompleteGovernanceReviewInfo>,
31+
query: web::Query<VerifierActionsQueryParams>,
3332
) -> impl Responder {
34-
let CompleteGovernanceReviewInfo { actor} = info.into_inner();
3533
let ldn_application = match LDNApplication::load(query.id.clone(), query.owner.clone(), query.repo.clone()).await {
3634
Ok(app) => app,
3735
Err(e) => {
@@ -40,7 +38,7 @@ pub async fn trigger(
4038
};
4139
dbg!(&ldn_application);
4240
match ldn_application
43-
.complete_governance_review(actor, query.owner.clone(), query.repo.clone())
41+
.complete_governance_review(query.github_username.clone(), query.owner.clone(), query.repo.clone())
4442
.await
4543
{
4644
Ok(app) => HttpResponse::Ok().body(serde_json::to_string_pretty(&app).unwrap()),

fplus-lib/src/core/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ pub struct LDNApplication {
6565
pub branch_name: String,
6666
}
6767

68-
#[derive(Debug, Serialize, Deserialize)]
69-
pub struct CompleteGovernanceReviewInfo {
70-
pub actor: String,
71-
}
72-
7368
#[derive(Deserialize, Debug)]
7469
pub struct RefillInfo {
7570
pub id: String,

0 commit comments

Comments
 (0)