Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added further route specifiers #411

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
IQueryable<Establishment> query = DefaultIncludes().AsNoTracking();
if (!string.IsNullOrEmpty(name))
{
query = query.Where(e => e.EstablishmentName.Contains(name));

Check warning on line 33 in Dfe.Academies.Api.Infrastructure/Repositories/EstablishmentRepository.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Dereference of a possibly null reference.
}
if (!string.IsNullOrEmpty(ukPrn))
{
Expand All @@ -43,7 +43,7 @@
query = query.Where(e => e.URN == urnAsNumber);
}
}
return await query.ToListAsync(cancellationToken);
return await query.Take(100).ToListAsync(cancellationToken);
}
public async Task<IEnumerable<int>> GetURNsByRegion(string[] regions, CancellationToken cancellationToken)
{
Expand Down
4 changes: 2 additions & 2 deletions TramsDataApi/Controllers/V4/TrustsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public TrustsController(ITrustQueries trustQueries, ILogger<TrustsController> lo
/// <param name="cancellationToken"></param>
/// <returns>A Trust or NotFound if not available.</returns>
[HttpGet]
[Route("trust/{ukprn}")]
[Route("trust/ukprn/{ukprn}")]
[SwaggerOperation(Summary = "Retrieve Trust by UK Provider Reference Number (UKPRN)", Description = "Returns a Trust identified by UK Provider Reference Number (UKPRN).")]
[SwaggerResponse(200, "Successfully found and returned the Trust.")]
[SwaggerResponse(404, "Trust with specified UK Provider Reference Number (UKPRN) not found.")]
Expand All @@ -62,7 +62,7 @@ public async Task<ActionResult<TrustDto>> GetTrustByUkprn(string ukprn, Cancella
/// <param name="cancellationToken"></param>
/// <returns>A Trust or NotFound if not available.</returns>
[HttpGet]
[Route("trust/{companiesHouseNumber}")]
[Route("trust/companiesHouseNumber/{companiesHouseNumber}")]
[SwaggerOperation(Summary = "Retrieve Trust by Companies House Number", Description = "Returns a Trust identified by Companies House Number.")]
[SwaggerResponse(200, "Successfully found and returned the Trust.")]
[SwaggerResponse(404, "Trust with specified Companies House Number not found.")]
Expand Down
Loading