Make list photos endpoint a get resource
All checks were successful
Core Repos/ImageApi/pipeline/pr-master This commit looks good

The request doesn't modify state and the path can be passed as a query
param so a GET makes more sense.
This commit is contained in:
Cameron Cordes
2021-03-29 15:42:59 -04:00
parent 44a6b582ab
commit 4249fd319c

View File

@@ -17,14 +17,10 @@ use actix_multipart as mp;
use actix_web::{
delete,
error::BlockingError,
get, post, put,
web::{self, BufMut, BytesMut},
get, middleware, post, put,
web::{self, BufMut, BytesMut, HttpRequest, HttpResponse, Query},
App, HttpServer, Responder,
};
use actix_web::{
middleware,
web::{HttpRequest, HttpResponse, Json},
};
use notify::{watcher, DebouncedEvent, RecursiveMode, Watcher};
use rayon::prelude::*;
use serde::Serialize;
@@ -42,8 +38,8 @@ mod database;
mod files;
mod video;
#[post("/photos")]
async fn list_photos(_claims: Claims, req: Json<ThumbnailRequest>) -> impl Responder {
#[get("/photos")]
async fn list_photos(_claims: Claims, req: Query<ThumbnailRequest>) -> impl Responder {
info!("{}", req.path);
let path = &req.path;