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