@@ -11,7 +11,7 @@ use crate::database::redis::RedisPool;
1111use crate :: database:: { self , models as db_models} ;
1212use crate :: file_hosting:: { FileHost , FileHostPublicity } ;
1313use crate :: models;
14- use crate :: models:: ids:: ProjectId ;
14+ use crate :: models:: ids:: { ProjectId , VersionId } ;
1515use crate :: models:: images:: ImageContext ;
1616use crate :: models:: notifications:: NotificationBody ;
1717use crate :: models:: pats:: Scopes ;
@@ -250,6 +250,8 @@ pub struct EditProject {
250250 pub monetization_status : Option < MonetizationStatus > ,
251251 pub side_types_migration_review_status :
252252 Option < SideTypesMigrationReviewStatus > ,
253+ #[ serde( flatten) ]
254+ pub loader_fields : HashMap < String , serde_json:: Value > ,
253255}
254256
255257#[ allow( clippy:: too_many_arguments) ]
@@ -870,6 +872,29 @@ pub async fn project_edit(
870872 . await ?;
871873 }
872874
875+ if !new_project. loader_fields . is_empty ( ) {
876+ for version in db_models:: DBVersion :: get_many (
877+ & project_item. versions ,
878+ & * * pool,
879+ & redis,
880+ )
881+ . await ?
882+ {
883+ super :: versions:: version_edit_helper (
884+ req. clone ( ) ,
885+ ( VersionId :: from ( version. inner . id ) , ) ,
886+ pool. clone ( ) ,
887+ redis. clone ( ) ,
888+ super :: versions:: EditVersion {
889+ fields : new_project. loader_fields . clone ( ) ,
890+ ..Default :: default ( )
891+ } ,
892+ session_queue. clone ( ) ,
893+ )
894+ . await ?;
895+ }
896+ }
897+
873898 // check new description and body for links to associated images
874899 // if they no longer exist in the description or body, delete them
875900 let checkable_strings: Vec < & str > =
0 commit comments