File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -336,8 +336,20 @@ pub async fn create_version(
336336 } ;
337337
338338 version. gd = mod_gd_versions:: create ( version. id , & json, & mut tx) . await ?;
339- dependencies:: create ( version. id , & json, & mut tx) . await ?;
340- incompatibilities:: create ( version. id , & json, & mut tx) . await ?;
339+ version. dependencies = Some (
340+ dependencies:: create ( version. id , & json, & mut tx)
341+ . await ?
342+ . into_iter ( )
343+ . map ( |x| x. into_response ( ) )
344+ . collect ( ) ,
345+ ) ;
346+ version. incompatibilities = Some (
347+ incompatibilities:: create ( version. id , & json, & mut tx)
348+ . await ?
349+ . into_iter ( )
350+ . map ( |x| x. into_response ( ) )
351+ . collect ( ) ,
352+ ) ;
341353
342354 if verified || accepted_versions == 0 {
343355 if let Some ( links) = json. links . clone ( ) {
@@ -376,7 +388,13 @@ pub async fn create_version(
376388 . to_discord_webhook ( )
377389 . send ( data. webhook_url ( ) ) ;
378390 }
379- Ok ( HttpResponse :: NoContent ( ) )
391+
392+ version. modify_metadata ( data. app_url ( ) , false ) ;
393+
394+ Ok ( HttpResponse :: Created ( ) . json ( ApiResponse {
395+ error : "" . into ( ) ,
396+ payload : version,
397+ } ) )
380398}
381399
382400#[ put( "v1/mods/{id}/versions/{version}" ) ]
You can’t perform that action at this time.
0 commit comments