Skip to content

Commit

Permalink
refactor(neon_framework): migrate Requestmanager.wrapWebDav to use ht…
Browse files Browse the repository at this point in the history
…tp.Request

Signed-off-by: Nikolas Rimikis <[email protected]>
  • Loading branch information
Leptopoda committed Apr 3, 2024
1 parent 67a122a commit fd5ab56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/neon/neon_files/lib/src/blocs/browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class _FilesBrowserBloc extends InteractiveBloc implements FilesBrowserBloc {
account: account,
cacheKey: 'files-${uri.value.path}',
subject: files,
request: () => account.client.webdav.propfind(
request: account.client.webdav.propfind_Request(
uri.value,
prop: const WebDavPropWithoutValues.fromBools(
davGetcontenttype: true,
Expand Down
9 changes: 6 additions & 3 deletions packages/neon_framework/lib/src/utils/request_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,18 @@ class RequestManager {
required Account account,
required String cacheKey,
required BehaviorSubject<Result<T>> subject,
required AsyncValueGetter<WebDavMultistatus> request,
required http.BaseRequest request,
required UnwrapCallback<T, WebDavMultistatus> unwrap,
bool disableTimeout = false,
}) async =>
}) =>
wrap<T, WebDavMultistatus>(
account: account,
cacheKey: cacheKey,
subject: subject,
request: request,
request: () async {
final response = await account.client.webdav.csrfClient.send(request);
return const WebDavResponseConverter().convert(response);

Check warning on line 118 in packages/neon_framework/lib/src/utils/request_manager.dart

View check run for this annotation

Codecov / codecov/patch

packages/neon_framework/lib/src/utils/request_manager.dart#L116-L118

Added lines #L116 - L118 were not covered by tests
},
unwrap: unwrap,
serialize: (data) => data.toXmlElement(namespaces: namespaces).toXmlString(),
deserialize: (data) => WebDavMultistatus.fromXmlElement(xml.XmlDocument.parse(data).rootElement),
Expand Down

0 comments on commit fd5ab56

Please sign in to comment.