66using Refresh . Database ;
77using Refresh . Database . Models . Assets ;
88using Refresh . Database . Models . Users ;
9+ using Refresh . Interfaces . APIv3 . Documentation . Descriptions ;
910using Refresh . Interfaces . APIv3 . Endpoints . ApiTypes ;
1011using Refresh . Interfaces . APIv3 . Endpoints . ApiTypes . Errors ;
1112using Refresh . Interfaces . APIv3 . Endpoints . DataTypes . Response . Data ;
@@ -15,15 +16,16 @@ namespace Refresh.Interfaces.APIv3.Endpoints.Admin;
1516
1617public class AdminAssetApiEndpoints : EndpointGroup
1718{
18- [ ApiV3Endpoint ( "admin/users/uuid/{uuid }/assets" ) , MinimumRole ( GameUserRole . Moderator ) ]
19+ [ ApiV3Endpoint ( "admin/users/{idType}/{id }/assets" ) , MinimumRole ( GameUserRole . Moderator ) ]
1920 [ DocSummary ( "Retrieves a list of assets uploaded by the user." ) ]
2021 [ DocQueryParam ( "assetType" , "The asset type to filter by. Can be excluded to list all types." ) ]
2122 [ DocError ( typeof ( ApiNotFoundError ) , ApiNotFoundError . UserMissingErrorWhen ) ]
2223 [ DocError ( typeof ( ApiValidationError ) , "The asset type could not be parsed." ) ]
2324 public ApiListResponse < ApiMinimalGameAssetResponse > GetAssetsByUser ( RequestContext context , GameDatabaseContext database , DataContext dataContext ,
24- [ DocSummary ( "The UUID of the user." ) ] string uuid )
25+ [ DocSummary ( SharedParamDescriptions . UserIdParam ) ] string id ,
26+ [ DocSummary ( SharedParamDescriptions . UserIdTypeParam ) ] string idType )
2527 {
26- GameUser ? user = database . GetUserByUuid ( uuid ) ;
28+ GameUser ? user = database . GetUserByIdAndType ( idType , id ) ;
2729 if ( user == null ) return ApiNotFoundError . UserMissingError ;
2830
2931 ( int skip , int count ) = context . GetPageData ( 1000 ) ;
0 commit comments