move_email endpoint
This commit is contained in:
		
							parent
							
								
									b5cb5b99fb
								
							
						
					
					
						commit
						b2fd9d16cc
					
				
					 1 changed files with 27 additions and 5 deletions
				
			
		|  | @ -143,10 +143,32 @@ class ApiService { | ||||||
|     return content; |     return content; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // void _addMailBox async(BuildContext context){ |   Future<bool> moveEmail(String fromFolder, String uID, String toFolder) async { | ||||||
|   //   //add email folder |     var url = Uri.http('$ip:$port', 'move_email'); | ||||||
|   //   showDialog(context: context, builder: builder) |     Map<String, String> requestBody = { | ||||||
|   // } |       'from': fromFolder, | ||||||
|  |       'uid': uID, | ||||||
|  |       'to': toFolder, | ||||||
|  |     }; | ||||||
|  |     try { | ||||||
|  |       var response = await http.post( | ||||||
|  |         url, | ||||||
|  |         headers: { | ||||||
|  |           'Content-Type': 'application/json', | ||||||
|  |         }, | ||||||
|  |         body: jsonEncode(requestBody), | ||||||
|  |       ); | ||||||
|  |       if (response.statusCode == 200) { | ||||||
|  |         print('response body ${response.body}'); | ||||||
|  |         return true; | ||||||
|  |       } else { | ||||||
|  |         print('error '); | ||||||
|  |       } | ||||||
|  |     } catch (e) { | ||||||
|  |       print(e); | ||||||
|  |     } | ||||||
|  |     return false; | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|   Future<List<String>> fetchFolders() async { |   Future<List<String>> fetchFolders() async { | ||||||
|     try { |     try { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue