some commented out ideas for posting data to nextcloud tables
This commit is contained in:
parent
6ad7472d83
commit
4913cfefc0
20
src/main.rs
20
src/main.rs
|
@ -1,5 +1,7 @@
|
||||||
mod api;
|
mod api;
|
||||||
|
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use actix_multipart::form::tempfile::TempFileConfig;
|
use actix_multipart::form::tempfile::TempFileConfig;
|
||||||
use actix_web::{middleware, App, HttpServer};
|
use actix_web::{middleware, App, HttpServer};
|
||||||
use api::church_form::church_form;
|
use api::church_form::church_form;
|
||||||
|
@ -7,6 +9,7 @@ use api::health_form::health_form;
|
||||||
use api::mt_form::mt_form;
|
use api::mt_form::mt_form;
|
||||||
use api::parent_form::parent_form;
|
use api::parent_form::parent_form;
|
||||||
use api::teacher_form::teacher_form;
|
use api::teacher_form::teacher_form;
|
||||||
|
use serde_json::{Number, Value};
|
||||||
|
|
||||||
#[actix_web::main]
|
#[actix_web::main]
|
||||||
async fn main() -> std::io::Result<()> {
|
async fn main() -> std::io::Result<()> {
|
||||||
|
@ -17,6 +20,23 @@ async fn main() -> std::io::Result<()> {
|
||||||
|
|
||||||
log::info!("starting HTTP server at http://localhost:4242");
|
log::info!("starting HTTP server at http://localhost:4242");
|
||||||
|
|
||||||
|
// let mut fields = HashMap::new();
|
||||||
|
// fields.insert("value", Value::String("Frodo".to_string()));
|
||||||
|
// fields.insert("columnId", Value::Number(Number::from(106)));
|
||||||
|
|
||||||
|
// let mut data = HashMap::new();
|
||||||
|
// data.insert("data", vec![fields]);
|
||||||
|
// // let vec = vec![data];
|
||||||
|
// log::info!("{:?}", serde_json::to_string(&data).unwrap());
|
||||||
|
|
||||||
|
// let req = reqwest::Client::new()
|
||||||
|
// .post("https://staff.tfcconnection.org/apps/tables/api/1/tables/9/rows")
|
||||||
|
// .basic_auth("chris", Some("2VHeGxeC^Zf9KqFK^G@Pt!zu2q^6@b"))
|
||||||
|
// .json(&data)
|
||||||
|
// .send()
|
||||||
|
// .await;
|
||||||
|
// log::info!("{:?}", req.unwrap().text().await.unwrap());
|
||||||
|
|
||||||
HttpServer::new(|| {
|
HttpServer::new(|| {
|
||||||
App::new()
|
App::new()
|
||||||
.wrap(middleware::Logger::default())
|
.wrap(middleware::Logger::default())
|
||||||
|
|
Loading…
Reference in a new issue