Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/luminork-server/src/service/v1/schemas/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub enum SchemaError {
Transactions(#[from] TransactionsError),
#[error("validation error: {0}")]
Validation(String),
#[error("variant authuring error: {0}")]
#[error("variant authoring error: {0}")]
VariantAuthoring(#[from] VariantAuthoringError),
#[error("workspace snapshot error: {0}")]
WorkspaceSnapshot(#[from] dal::WorkspaceSnapshotError),
Expand Down
20 changes: 17 additions & 3 deletions lib/luminork-server/src/service/v1/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ impl IntoResponse for UserError {
}
}

pub enum UserResultV1 {
Empty
}

impl IntoResponse for UserResultV1 {
fn into_response(self) -> Response {
match self {
Self::Empty => {
StatusCode::NO_CONTENT.into_response()
}
}
}
}

#[utoipa::path(
post,
path = "/v1/w/{workspace_id}/user/set_ai_agent_executed",
Expand All @@ -68,14 +82,14 @@ impl IntoResponse for UserError {
),
tag = "user",
responses(
(status = 200, description = "Flag set successfully"),
(status = 204, description = "Flag set successfully"),
(status = 401, description = "Unauthorized - Invalid or missing token"),
(status = 500, description = "Internal server error", body = crate::service::v1::common::ApiError)
)
)]
pub async fn set_ai_agent_executed(
WorkspaceDalContext(ref ctx): WorkspaceDalContext,
) -> UserResult<()> {
) -> UserResult<UserResultV1> {
let HistoryActor::User(user_pk) = ctx.history_actor() else {
return Err(UserError::MissingUser);
};
Expand All @@ -96,5 +110,5 @@ pub async fn set_ai_agent_executed(

ctx.commit().await?;

Ok(())
Ok(UserResultV1::Empty)
}