mirror of
https://git.asonix.dog/asonix/relay.git
synced 2025-05-29 13:07:21 +00:00
21 lines
400 B
Rust
21 lines
400 B
Rust
use actix_web::HttpResponse;
|
|
use serde::ser::Serialize;
|
|
|
|
static CONTENT_TYPE: &str = "application/activity+json";
|
|
|
|
pub fn ok<T>(item: T) -> HttpResponse
|
|
where
|
|
T: Serialize,
|
|
{
|
|
HttpResponse::Ok().content_type(CONTENT_TYPE).json(item)
|
|
}
|
|
|
|
pub fn accepted<T>(item: T) -> HttpResponse
|
|
where
|
|
T: Serialize,
|
|
{
|
|
HttpResponse::Accepted()
|
|
.content_type(CONTENT_TYPE)
|
|
.json(item)
|
|
}
|