Skip to content

Commit ab59c2a

Browse files
author
gauffininteractive
committed
hit the wrong key :| Part of the future dates fix.
1 parent 139f016 commit ab59c2a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Server/OneTrueError.SqlServer/Core/Applications/Queries/GetApplicationOverviewHandler.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ public async Task<GetApplicationOverviewResult> ExecuteAsync(GetApplicationOverv
4343
var sql = @"select cast(Incidents.CreatedAtUtc as date), count(Id)
4444
from Incidents
4545
where Incidents.CreatedAtUtc >= @minDate
46+
AND Incidents.CreatedAtUtc <= GetUtcDate()
4647
{0}
4748
group by cast(Incidents.CreatedAtUtc as date);
4849
select cast(ErrorReports.CreatedAtUtc as date), count(Id)
4950
from ErrorReports
5051
where ErrorReports.CreatedAtUtc >= @minDate
52+
AND ErrorReports.CreatedAtUtc <= GetUtcDate()
5153
{1}
5254
group by cast(ErrorReports.CreatedAtUtc as date);";
5355

@@ -94,22 +96,26 @@ private async Task GetStatSummary(GetApplicationOverview query, GetApplicationOv
9496
{
9597
cmd.CommandText = @"select count(id) from incidents
9698
where CreatedAtUtc >= @minDate
99+
AND CreatedAtUtc <= GetUtcDate()
97100
AND ApplicationId = @appId
98101
AND Incidents.IgnoreReports = 0
99102
AND Incidents.IsSolved = 0;
100103
101104
select count(id) from errorreports
102105
where CreatedAtUtc >= @minDate
106+
AND CreatedAtUtc <= GetUtcDate()
103107
AND ApplicationId = @appId;
104108
105109
select count(distinct emailaddress) from IncidentFeedback
106110
where CreatedAtUtc >= @minDate
111+
AND CreatedAtUtc <= GetUtcDate()
107112
AND ApplicationId = @appId
108113
AND emailaddress is not null
109114
AND DATALENGTH(emailaddress) > 0;
110115
111116
select count(*) from IncidentFeedback
112117
where CreatedAtUtc >= @minDate
118+
AND CreatedAtUtc <= GetUtcDate()
113119
AND ApplicationId = @appId
114120
AND Description is not null
115121
AND DATALENGTH(Description) > 0;";
@@ -164,11 +170,13 @@ private async Task<GetApplicationOverviewResult> GetTodaysOverviewAsync(GetAppli
164170
var sql = @"SELECT DATEPART(HOUR, Incidents.CreatedAtUtc), cast(count(Id) as int)
165171
from Incidents
166172
where Incidents.CreatedAtUtc >= @minDate
173+
AND Incidents.CreatedAtUtc <= GetUtcDate()
167174
{0}
168175
group by DATEPART(HOUR, Incidents.CreatedAtUtc);
169176
select DATEPART(HOUR, ErrorReports.CreatedAtUtc), cast(count(Id) as int)
170177
from ErrorReports
171178
where ErrorReports.CreatedAtUtc >= @minDate
179+
AND ErrorReports.CreatedAtUtc <= GetUtcDate()
172180
{1}
173181
group by DATEPART(HOUR, ErrorReports.CreatedAtUtc);";
174182

src/Server/OneTrueError.SqlServer/Core/Incidents/Queries/FindIncidentsHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ JOIN Applications ON (Applications.Id = Incidents.ApplicationId)
3434
cmd.AddParameter("accountId", ClaimsPrincipal.Current.GetAccountId());
3535
if (query.ApplicationId > 0)
3636
{
37-
sqlQuery += " WHERE ApplicationId = @id AND (";
37+
sqlQuery += " WHERE Applications.Id = @id AND (";
3838
cmd.AddParameter("id", query.ApplicationId);
3939
}
4040
else

0 commit comments

Comments
 (0)