Skip to content
Merged
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
10 changes: 9 additions & 1 deletion server/src/handlers/http/users/dashboards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use crate::{
};
use actix_web::{http::header::ContentType, web, HttpRequest, HttpResponse, Responder};
use bytes::Bytes;
use rand::distributions::DistString;

use chrono::Utc;
use http::StatusCode;
Expand Down Expand Up @@ -61,7 +62,14 @@ pub async fn post(req: HttpRequest, body: Bytes) -> Result<impl Responder, Dashb

dashboard.user_id = Some(user_id.clone());
for tile in dashboard.tiles.iter_mut() {
tile.tile_id = Some(get_hash(Utc::now().timestamp_micros().to_string().as_str()));
tile.tile_id = Some(get_hash(
format!(
"{}{}",
rand::distributions::Alphanumeric.sample_string(&mut rand::thread_rng(), 8),
Utc::now().timestamp_micros()
)
.as_str(),
));
}
DASHBOARDS.update(&dashboard);

Expand Down
Loading