get endpoint works
This commit is contained in:
@@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user