9 lines
312 B
Rust
9 lines
312 B
Rust
use super::model::StatusPageResponse;
|
|
use crate::i18n::t;
|
|
use anyhow::{Context, Ok, Result};
|
|
|
|
pub fn parse_response(json_text: &str) -> Result<StatusPageResponse> {
|
|
let response: StatusPageResponse =
|
|
serde_json::from_str(json_text).with_context(|| t("invalid-json-status-page"))?;
|
|
Ok(response)
|
|
}
|