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