rename and delete api calls
This commit is contained in:
parent
c09f4e7a11
commit
a65c973dc7
@ -122,8 +122,8 @@ class ApiService {
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
content += response.body;
|
content += response.body;
|
||||||
try {
|
try {
|
||||||
List<AttachmentInfo> attachments = await getAttachmentsInfo(
|
List<AttachmentInfo> attachments =
|
||||||
emailFolder, id);
|
await getAttachmentsInfo(emailFolder, id);
|
||||||
for (var attachment in attachments) {
|
for (var attachment in attachments) {
|
||||||
//TODO: for each attachment creaate at the bottom a widget for each individual one
|
//TODO: for each attachment creaate at the bottom a widget for each individual one
|
||||||
threadAttachments
|
threadAttachments
|
||||||
@ -164,6 +164,31 @@ class ApiService {
|
|||||||
|
|
||||||
Map<String, String> requestBody = {'name': folderName};
|
Map<String, String> requestBody = {'name': folderName};
|
||||||
|
|
||||||
|
try {
|
||||||
|
var response = await http.post(
|
||||||
|
url,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: jsonEncode(requestBody),
|
||||||
|
);
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
print('response body: ${response.body}');
|
||||||
|
} else {
|
||||||
|
print('Error: ${response.statusCode}, response body: ${response.body}');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
print('error making post req: $e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> renameFolder(String oldFolder, String newFolder) async {
|
||||||
|
var url = Uri.http('$ip:$port', 'rename_folder');
|
||||||
|
Map<String, String> requestBody = {
|
||||||
|
'old_name': oldFolder,
|
||||||
|
'new_name': newFolder,
|
||||||
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var response = await http.post(
|
var response = await http.post(
|
||||||
url,
|
url,
|
||||||
@ -268,7 +293,6 @@ class ApiService {
|
|||||||
//leads to problems as for a) the html is added one right after the other in one iframe, b)
|
//leads to problems as for a) the html is added one right after the other in one iframe, b)
|
||||||
// if it was multiple iframes then the scrolling to jump would not work as expected
|
// if it was multiple iframes then the scrolling to jump would not work as expected
|
||||||
|
|
||||||
|
|
||||||
print("marker called");
|
print("marker called");
|
||||||
// JavaScript code embedded as a string
|
// JavaScript code embedded as a string
|
||||||
String jsCode = '''
|
String jsCode = '''
|
||||||
@ -379,7 +403,7 @@ class _EmailViewState extends State<EmailView> {
|
|||||||
String currentContent = widget.emailContent;
|
String currentContent = widget.emailContent;
|
||||||
viewTypeId = "iframe-${DateTime.now().millisecondsSinceEpoch}";
|
viewTypeId = "iframe-${DateTime.now().millisecondsSinceEpoch}";
|
||||||
_registerViewFactory(currentContent);
|
_registerViewFactory(currentContent);
|
||||||
_markerPositionsFuture = ApiService().getMarkerPosition();
|
_markerPositionsFuture = ApiService().getMarkerPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _registerViewFactory(String currentContent) {
|
void _registerViewFactory(String currentContent) {
|
||||||
|
Loading…
Reference in New Issue
Block a user