Skip to content

Commit

Permalink
Delete obsolete code and make 'buildings' same as 'building'
Browse files Browse the repository at this point in the history
  • Loading branch information
russtuck committed Jul 10, 2024
1 parent 2e70441 commit 029bd6b
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions Gordon360/Controllers/AdvancedSearchController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,13 @@ public ActionResult<IEnumerable<string>> GetDepartments()
/// <returns> All buildings</returns>
[HttpGet]
[Route("building")]
[Route("buildings")]
public async Task<ActionResult<IEnumerable<BuildingViewModel>>> GetBuildingsAsync([FromServices] webSQLContext webSQLContext)
{
var buildings = await webSQLContext.Procedures.account_list_buildingsAsync();
return Ok(buildings.Select(b => new BuildingViewModel(b.BLDG_CDE, b.BUILDING_DESC)));
}

/// <summary>
/// Return a list of buildings.
/// </summary>
/// <returns> All buildings</returns>
[Obsolete("Use GetBuildingsAsync that gives structured building data")]
[HttpGet]
[Route("buildings")]
public ActionResult<IEnumerable<string>> GetBuildings()
{
var buildings = context.FacStaff.Select(fs => fs.BuildingDescription)
.Distinct()
.Where(d => d != null)
.OrderBy(d => d);
return Ok(buildings);
}

/// <summary>
/// Return a list of involvements' descriptions.
/// </summary>
Expand Down

0 comments on commit 029bd6b

Please sign in to comment.