Skip to content

Commit d269a9b

Browse files
committed
queue data
added queue position and length info to reject response
1 parent ce6f144 commit d269a9b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Tetrifact.Web/Controllers/TicketsController.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Microsoft.AspNetCore.Mvc;
22
using Microsoft.Extensions.Logging;
33
using System;
4-
using System.Linq;
54
using Tetrifact.Core;
65

76
namespace Tetrifact.Web

src/Tetrifact.Web/Core/Responses.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static NotFoundObjectResult NotFoundError(Controller controller, string d
1818
statusCode = 404,
1919
error = new
2020
{
21-
description = description
21+
description
2222
}
2323
});
2424
}
@@ -29,7 +29,9 @@ public static ObjectResult QueueFull(int position, int total)
2929
{
3030
error = new
3131
{
32-
description = $"Queue is full, you are {position} of {total}."
32+
description = $"Queue is full, you are {position} of {total}.",
33+
queue_position = position,
34+
queue_length = total
3335
}
3436
})
3537
{
@@ -128,7 +130,7 @@ public static BadRequestObjectResult GeneralUserError(string description)
128130
error = new
129131
{
130132
code = 101,
131-
description = description
133+
description
132134
}
133135
});
134136
}

0 commit comments

Comments
 (0)