fix: return empty ticket list when no tickets found
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||||
<M42ExtensionId>6673a25d-33d6-4072-91d9-abed4be1a966</M42ExtensionId>
|
<M42ExtensionId>6673a25d-33d6-4072-91d9-abed4be1a966</M42ExtensionId>
|
||||||
<M42AssemblyPattern>C4ITF4SD*.*</M42AssemblyPattern>
|
<M42AssemblyPattern>C4ITF4SD*.*</M42AssemblyPattern>
|
||||||
<M42PackageVersion>1.4.0.37</M42PackageVersion>
|
<M42PackageVersion>1.4.0.38</M42PackageVersion>
|
||||||
<M42BuildPackage>true</M42BuildPackage>
|
<M42BuildPackage>true</M42BuildPackage>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ namespace C4IT.F4SD
|
|||||||
if (activityTable?.Rows == null || activityTable.Rows.Count == 0)
|
if (activityTable?.Rows == null || activityTable.Rows.Count == 0)
|
||||||
{
|
{
|
||||||
LogEntry($"No activity entries found for userSid: '{userSid}'", LogLevels.Warning);
|
LogEntry($"No activity entries found for userSid: '{userSid}'", LogLevels.Warning);
|
||||||
return null;
|
return new List<cF4SDTicketSummary>();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < activityTable.Rows.Count; i++)
|
for (int i = 0; i < activityTable.Rows.Count; i++)
|
||||||
@@ -291,7 +291,7 @@ namespace C4IT.F4SD
|
|||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
LogException(E);
|
LogException(E);
|
||||||
return null;
|
return new List<cF4SDTicketSummary>();
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ namespace C4IT.F4SD
|
|||||||
hours,
|
hours,
|
||||||
queueoption,
|
queueoption,
|
||||||
decodedPairs
|
decodedPairs
|
||||||
);
|
) ?? new List<cF4SDTicketSummary>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -327,11 +327,11 @@
|
|||||||
"script": {
|
"script": {
|
||||||
"type": "text/javascript",
|
"type": "text/javascript",
|
||||||
"exec": [
|
"exec": [
|
||||||
"pm.test(\"Ticket list is array or null\", function () {",
|
"pm.test(\"Ticket list is an array\", function () {",
|
||||||
" const text = pm.response.text();",
|
" const text = pm.response.text();",
|
||||||
" if (!text) return;",
|
" pm.expect(text).to.not.equal(\"\");",
|
||||||
" const json = pm.response.json();",
|
" const json = pm.response.json();",
|
||||||
" pm.expect(json === null || Array.isArray(json)).to.equal(true);",
|
" pm.expect(Array.isArray(json)).to.equal(true);",
|
||||||
"});",
|
"});",
|
||||||
"",
|
"",
|
||||||
"const tickets = pm.response.text() ? pm.response.json() : null;",
|
"const tickets = pm.response.text() ? pm.response.json() : null;",
|
||||||
|
|||||||
Reference in New Issue
Block a user