File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Tests/ManagedCode.Storage.Tests/Storages/CloudDrive Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,22 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
170170 if ( path . StartsWith ( "/drive/v3/files/" , StringComparison . OrdinalIgnoreCase ) )
171171 {
172172 var fileId = path [ "/drive/v3/files/" . Length ..] ;
173+
174+ // Handle PATCH for trash operation (soft delete)
175+ if ( request . Method == HttpMethod . Patch )
176+ {
177+ if ( ! _entriesById . TryGetValue ( fileId , out var entry ) )
178+ {
179+ return new HttpResponseMessage ( HttpStatusCode . NotFound ) ;
180+ }
181+
182+ // Remove the entry (simulates trashing)
183+ _entriesById . Remove ( fileId ) ;
184+ _idByParentAndName . Remove ( ( entry . ParentId , entry . Name ) ) ;
185+
186+ return JsonResponse ( new { id = fileId , name = entry . Name , trashed = true } ) ;
187+ }
188+
173189 if ( request . Method == HttpMethod . Delete )
174190 {
175191 if ( ! _entriesById . Remove ( fileId ) )
You can’t perform that action at this time.
0 commit comments