mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
fix(csharp-mvc): show empty table in forgotten files page if error occurs
This commit is contained in:
@ -44,24 +44,31 @@ namespace OnlineEditorsExampleMVC.Controllers
|
||||
|
||||
var files = new List<Dictionary<string, string>>();
|
||||
|
||||
var response = TrackManager.commandRequest("getForgottenList", null);
|
||||
ArrayList keys = (ArrayList)response["keys"];
|
||||
|
||||
// fetch forgotten files from the document server
|
||||
foreach (string key in keys)
|
||||
try
|
||||
{
|
||||
var file = new Dictionary<string, string>();
|
||||
var fileResult = TrackManager.commandRequest("getForgotten", key);
|
||||
file.Add("key", fileResult["key"].ToString());
|
||||
file.Add("url", fileResult["url"].ToString());
|
||||
file.Add(
|
||||
"type",
|
||||
FileUtility.GetFileType(fileResult["url"].ToString())
|
||||
.ToString()
|
||||
.ToLower()
|
||||
);
|
||||
var response = TrackManager.commandRequest("getForgottenList", null);
|
||||
ArrayList keys = (ArrayList)response["keys"];
|
||||
|
||||
files.Add(file);
|
||||
// fetch all the forgotten files from the document server
|
||||
foreach (string key in keys)
|
||||
{
|
||||
var file = new Dictionary<string, string>();
|
||||
var fileResult = TrackManager.commandRequest("getForgotten", key);
|
||||
file.Add("key", fileResult["key"].ToString());
|
||||
file.Add("url", fileResult["url"].ToString());
|
||||
file.Add(
|
||||
"type",
|
||||
FileUtility.GetFileType(fileResult["url"].ToString())
|
||||
.ToString()
|
||||
.ToLower()
|
||||
);
|
||||
|
||||
files.Add(file);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(ex.Message);
|
||||
}
|
||||
|
||||
return View("Forgotten", new ForgottenFilesModel(files));
|
||||
|
||||
Reference in New Issue
Block a user