params need to use query

This commit is contained in:
Felix Ableitner 2023-06-30 15:16:48 +02:00
parent 677b76f373
commit 093101d7c1
6 changed files with 12 additions and 12 deletions

View file

@ -4,7 +4,7 @@ use crate::{
objects::community::ApubCommunity,
};
use activitypub_federation::config::Data;
use actix_web::web::Json;
use actix_web::web::{Json, Query};
use lemmy_api_common::{
comment::{GetComments, GetCommentsResponse},
context::LemmyContext,
@ -19,7 +19,7 @@ use lemmy_utils::error::LemmyError;
#[tracing::instrument(skip(context))]
pub async fn list_comments(
data: Json<GetComments>,
data: Query<GetComments>,
context: Data<LemmyContext>,
) -> Result<Json<GetCommentsResponse>, LemmyError> {
let local_user_view = local_user_view_from_jwt_opt(data.auth.as_ref(), &context).await;

View file

@ -4,7 +4,7 @@ use crate::{
objects::community::ApubCommunity,
};
use activitypub_federation::config::Data;
use actix_web::web::Json;
use actix_web::web::{Json, Query};
use lemmy_api_common::{
context::LemmyContext,
post::{GetPosts, GetPostsResponse},
@ -16,7 +16,7 @@ use lemmy_utils::error::LemmyError;
#[tracing::instrument(skip(context))]
pub async fn list_posts(
data: Json<GetPosts>,
data: Query<GetPosts>,
context: Data<LemmyContext>,
) -> Result<Json<GetPostsResponse>, LemmyError> {
let local_user_view = local_user_view_from_jwt_opt(data.auth.as_ref(), &context).await;

View file

@ -1,6 +1,6 @@
use crate::{fetcher::resolve_actor_identifier, objects::community::ApubCommunity};
use activitypub_federation::config::Data;
use actix_web::web::Json;
use actix_web::web::{Json, Query};
use lemmy_api_common::{
community::{GetCommunity, GetCommunityResponse},
context::LemmyContext,
@ -17,7 +17,7 @@ use lemmy_utils::error::LemmyError;
#[tracing::instrument(skip(context))]
pub async fn read_community(
data: Json<GetCommunity>,
data: Query<GetCommunity>,
context: Data<LemmyContext>,
) -> Result<Json<GetCommunityResponse>, LemmyError> {
let local_user_view = local_user_view_from_jwt_opt(data.auth.as_ref(), &context).await;

View file

@ -1,6 +1,6 @@
use crate::{fetcher::resolve_actor_identifier, objects::person::ApubPerson};
use activitypub_federation::config::Data;
use actix_web::web::Json;
use actix_web::web::{Json, Query};
use lemmy_api_common::{
context::LemmyContext,
person::{GetPersonDetails, GetPersonDetailsResponse},
@ -16,7 +16,7 @@ use lemmy_utils::error::LemmyError;
#[tracing::instrument(skip(context))]
pub async fn read_person(
data: Json<GetPersonDetails>,
data: Query<GetPersonDetails>,
context: Data<LemmyContext>,
) -> Result<Json<GetPersonDetailsResponse>, LemmyError> {
// Check to make sure a person name or an id is given

View file

@ -1,6 +1,6 @@
use crate::fetcher::search::{search_query_to_object_id, SearchableObjects};
use activitypub_federation::config::Data;
use actix_web::web::Json;
use actix_web::web::{Json, Query};
use diesel::NotFound;
use lemmy_api_common::{
context::LemmyContext,
@ -14,7 +14,7 @@ use lemmy_utils::error::LemmyError;
#[tracing::instrument(skip(context))]
pub async fn resolve_object(
data: Json<ResolveObject>,
data: Query<ResolveObject>,
context: Data<LemmyContext>,
) -> Result<Json<ResolveObjectResponse>, LemmyError> {
let local_user_view = local_user_view_from_jwt(&data.auth, &context).await?;

View file

@ -1,6 +1,6 @@
use crate::{fetcher::resolve_actor_identifier, objects::community::ApubCommunity};
use activitypub_federation::config::Data;
use actix_web::web::Json;
use actix_web::web::{Json, Query};
use lemmy_api_common::{
context::LemmyContext,
site::{Search, SearchResponse},
@ -17,7 +17,7 @@ use lemmy_utils::error::LemmyError;
#[tracing::instrument(skip(context))]
pub async fn search(
data: Json<Search>,
data: Query<Search>,
context: Data<LemmyContext>,
) -> Result<Json<SearchResponse>, LemmyError> {
let local_user_view = local_user_view_from_jwt_opt(data.auth.as_ref(), &context).await;