[LLC -> AttachmentFileUploader] Add remaining delete methods

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-02-19 14:10:48 +05:30
parent 3d1bfc7039
commit a291c8dbcf
3 changed files with 98 additions and 10 deletions
+36 -2
View File
@@ -822,10 +822,14 @@ class StreamChatClient {
Future<Response<String>> delete(
String path, {
Map<String, dynamic> queryParameters,
CancelToken cancelToken,
}) async {
try {
final response = await httpClient.delete<String>(path,
queryParameters: queryParameters);
final response = await httpClient.delete<String>(
path,
queryParameters: queryParameters,
cancelToken: cancelToken,
);
return response;
} on DioError catch (error) {
throw _parseError(error);
@@ -1076,6 +1080,36 @@ class StreamChatClient {
);
}
/// Delete a file from this channel
Future<EmptyResponse> deleteFile(
String url,
String channelId,
String channelType, {
CancelToken cancelToken,
}) {
return attachmentFileUploader.deleteFile(
url,
channelId,
channelType,
cancelToken: cancelToken,
);
}
/// Delete an image from this channel
Future<EmptyResponse> deleteImage(
String url,
String channelId,
String channelType, {
CancelToken cancelToken,
}) {
return attachmentFileUploader.deleteImage(
url,
channelId,
channelType,
cancelToken: cancelToken,
);
}
/// Add a device for Push Notifications.
Future<EmptyResponse> addDevice(String id, PushProvider pushProvider) async {
final response = await post('/devices', data: {