Add API to remove files from a collection
This commit is contained in:
parent
56c31318d4
commit
31fef9cd3a
1 changed files with 17 additions and 0 deletions
|
@ -206,6 +206,23 @@ class CollectionsService {
|
|||
);
|
||||
}
|
||||
|
||||
Future<void> removeFromCollection(int collectionID, List<File> files) {
|
||||
final params = Map<String, dynamic>();
|
||||
params["collectionID"] = collectionID;
|
||||
for (final file in files) {
|
||||
if (params["fileIDs"] == null) {
|
||||
params["fileIDs"] = [];
|
||||
}
|
||||
params["fileIDs"].add(file.uploadedFileID);
|
||||
}
|
||||
return Dio().post(
|
||||
Configuration.instance.getHttpEndpoint() + "/collections/remove-files",
|
||||
data: params,
|
||||
options:
|
||||
Options(headers: {"X-Auth-Token": Configuration.instance.getToken()}),
|
||||
);
|
||||
}
|
||||
|
||||
Future<Collection> createAndCacheCollection(Collection collection) async {
|
||||
return Dio()
|
||||
.post(
|
||||
|
|
Loading…
Add table
Reference in a new issue