Skip to content

Commit

Permalink
feat: add POST method for /holder/credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
nanderstabel committed Dec 10, 2024
1 parent 14cf044 commit f4c3409
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions agent_api_rest/src/holder/holder/credentials/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use agent_holder::{credential::command::CredentialCommand, state::HolderState};
use agent_shared::{
generate_random_string,
handlers::{command_handler, query_handler},
};
use agent_shared::handlers::{command_handler, query_handler};
use axum::{
extract::{Path, State},
response::{IntoResponse, Response},
Expand All @@ -13,7 +10,6 @@ use identity_credential::credential::Jwt;
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};
use tracing::info;
use uuid::Uuid;

#[axum_macros::debug_handler]
pub(crate) async fn credentials(State(state): State<HolderState>) -> Response {
Expand Down
4 changes: 2 additions & 2 deletions agent_api_rest/src/holder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use agent_holder::state::HolderState;
use axum::routing::get;
use axum::{routing::post, Router};
use holder::{
credentials::credential,
credentials::{credential, post_credentials},
presentations::{get_presentations, post_presentations, presentation, presentation_signed::presentation_signed},
};

Expand All @@ -21,7 +21,7 @@ pub fn router(holder_state: HolderState) -> Router {
.nest(
API_VERSION,
Router::new()
.route("/holder/credentials", get(credentials))
.route("/holder/credentials", get(credentials).post(post_credentials))
.route("/holder/credentials/:credential_id", get(credential))
.route("/holder/presentations", get(get_presentations).post(post_presentations))
.route("/holder/presentations/:presentation_id", get(presentation))
Expand Down

0 comments on commit f4c3409

Please sign in to comment.