Create an empty folder if a 404 is received
This commit is contained in:
parent
321682536d
commit
b12b6de630
1 changed files with 19 additions and 8 deletions
|
@ -100,14 +100,25 @@ class FolderSharingService {
|
|||
Future<Folder> getFolder(String deviceFolder) async {
|
||||
return _dio
|
||||
.get(
|
||||
Configuration.instance.getHttpEndpoint() + "/folders/folder/",
|
||||
queryParameters: {
|
||||
"deviceFolder": deviceFolder,
|
||||
},
|
||||
options: Options(
|
||||
headers: {"X-Auth-Token": Configuration.instance.getToken()}),
|
||||
)
|
||||
.then((response) => Folder.fromMap(response.data));
|
||||
Configuration.instance.getHttpEndpoint() + "/folders/folder/",
|
||||
queryParameters: {
|
||||
"deviceFolder": deviceFolder,
|
||||
},
|
||||
options:
|
||||
Options(headers: {"X-Auth-Token": Configuration.instance.getToken()}),
|
||||
)
|
||||
.then((response) {
|
||||
return Folder.fromMap(response.data);
|
||||
}).catchError((e) {
|
||||
return Folder(
|
||||
null,
|
||||
Configuration.instance.getUsername() + "'s " + deviceFolder,
|
||||
Configuration.instance.getUsername(),
|
||||
deviceFolder,
|
||||
Set<String>(),
|
||||
null,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Future<Map<String, bool>> getSharingStatus(Folder folder) async {
|
||||
|
|
Loading…
Add table
Reference in a new issue