wip datetime impl

This commit is contained in:
Per Stark
2025-01-13 20:36:07 +01:00
parent 9b95321869
commit 81a4a68d70
19 changed files with 200 additions and 163 deletions

View File

@@ -8,7 +8,7 @@ use axum::{extract::State, http::StatusCode, response::IntoResponse, Extension};
use axum_typed_multipart::{FieldData, TryFromMultipart, TypedMultipart};
use futures::{future::try_join_all, TryFutureExt};
use tempfile::NamedTempFile;
use tracing::info;
use tracing::{debug, info};
#[derive(Debug, TryFromMultipart)]
pub struct IngressParams {
@@ -32,6 +32,8 @@ pub async fn ingress_data(
}))
.await?;
debug!("Got file infos");
let ingress_objects = create_ingress_objects(
IngressInput {
content: input.content,
@@ -41,6 +43,7 @@ pub async fn ingress_data(
},
user.id.as_str(),
)?;
debug!("Got ingress objects");
let futures: Vec<_> = ingress_objects
.into_iter()

View File

@@ -37,6 +37,10 @@ pub async fn index_handler(
false => 0,
};
// let latest_text_contents = match auth.current_user.is_some() {
// true =>
// }
// let knowledge_entities = User::get_knowledge_entities(
// &auth.current_user.clone().unwrap().id,
// &state.surreal_db_client,

View File

@@ -9,6 +9,7 @@ use axum_session_auth::AuthSession;
use axum_session_surreal::SessionSurrealPool;
use serde::{Deserialize, Serialize};
use surrealdb::{engine::any::Any, Surreal};
use tracing::info;
use crate::{
error::{AppError, HtmlError},
@@ -63,7 +64,8 @@ pub async fn process_signup_and_show_verification(
) -> Result<impl IntoResponse, HtmlError> {
let user = match User::create_new(form.email, form.password, &state.surreal_db_client).await {
Ok(user) => user,
Err(_) => {
Err(e) => {
info!("{:?}", e);
return Ok(Html("<p>User already exists</p>").into_response());
}
};