@@ -25,7 +25,7 @@ use actix_cors::Cors;
2525use actix_web:: cookie:: time:: Duration ;
2626use actix_web:: cookie:: Cookie ;
2727use actix_web:: web:: { Json , Path } ;
28- use actix_web:: { delete, get, post, web, App , HttpResponse , HttpServer , Responder } ;
28+ use actix_web:: { delete, get, post, put , web, App , HttpResponse , HttpServer , Responder } ;
2929use actix_web_httpauth:: extractors:: bearer:: BearerAuth ;
3030use actix_web_httpauth:: middleware:: HttpAuthentication ;
3131use argonautica:: Verifier ;
@@ -118,7 +118,7 @@ async fn filter_tickets(payload: Json<FilterPayload>) -> impl Responder {
118118 }
119119}
120120
121- #[ post ( "/tickets/{id}" ) ]
121+ #[ put ( "/tickets/{id}" ) ]
122122async fn edit ( payload : Json < TicketPayload > , ticket_id : Path < i32 > ) -> impl Responder {
123123 let ticket_id: i32 = ticket_id. into_inner ( ) ;
124124
@@ -411,7 +411,7 @@ mod tests {
411411 "labels" : [ ]
412412 } ) ;
413413
414- let req = TestRequest :: post ( )
414+ let req = TestRequest :: put ( )
415415 . uri ( "/tickets/-1" )
416416 . set_json ( payload)
417417 . to_request ( ) ;
@@ -457,7 +457,7 @@ mod tests {
457457 } ) ;
458458
459459 let app = test:: init_service ( App :: new ( ) . service ( edit) ) . await ;
460- let req = TestRequest :: post ( )
460+ let req = TestRequest :: put ( )
461461 . uri ( "/tickets/1" )
462462 . set_json ( payload)
463463 . to_request ( ) ;
0 commit comments