showing id now also when executing a get Request
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::i32;
|
||||
|
||||
use axum::{Json, debug_handler, extract::{Query, State}, http::StatusCode, response::IntoResponse};
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -7,6 +9,7 @@ use crate::{AppState, types::Alarm};
|
||||
|
||||
#[derive(ToSchema, Serialize)]
|
||||
pub struct OkResponse {
|
||||
id: i32,
|
||||
title: String,
|
||||
enabled: bool,
|
||||
time: DateTime<Utc>,
|
||||
@@ -39,6 +42,7 @@ pub struct RequestQuery {
|
||||
impl From<Alarm> for OkResponse {
|
||||
fn from(value: Alarm) -> Self {
|
||||
Self {
|
||||
id: value.id,
|
||||
title: value.title,
|
||||
enabled: value.enabled,
|
||||
time: value.time,
|
||||
|
||||
Reference in New Issue
Block a user