get endpoint works

This commit is contained in:
2026-03-03 12:14:39 +01:00
parent 3db69454e4
commit 0ad039a597
5 changed files with 42 additions and 25 deletions

View File

@@ -1,4 +1,4 @@
use chrono::{DateTime, Local};
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use crate::model;
@@ -6,11 +6,11 @@ use crate::model;
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Alarm {
pub enabled: bool,
pub time: DateTime<Local>,
pub time: DateTime<Utc>,
}
impl Alarm {
pub fn new(enabled: bool, time: DateTime<Local>) -> Self {
pub fn new(enabled: bool, time: DateTime<Utc>) -> Self {
Self { enabled, time }
}
}
@@ -19,7 +19,7 @@ impl From<model::alarm::Model> for Alarm {
fn from(value: model::alarm::Model) -> Self {
Self {
enabled: value.enabled,
time: DateTime::fromna,
time: DateTime::from_utc(value.time, Utc),
}
}
}