Skip to content

Commit

Permalink
Schedule: remove course code spaces in SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
EjPlatzer committed Sep 6, 2024
1 parent 4d2932d commit f606b3c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 64 deletions.
2 changes: 1 addition & 1 deletion Gordon360/Controllers/ScheduleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Gordon360.Controllers;

[Route("api/[controller]")]
public partial class ScheduleController(IScheduleService scheduleService) : GordonControllerBase
public class ScheduleController(IScheduleService scheduleService) : GordonControllerBase
{
[HttpGet]
[Route("{username}/courses")]
Expand Down
57 changes: 0 additions & 57 deletions Gordon360/Documentation/Gordon360.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions Gordon360/Models/ViewModels/ScheduleCourseViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text.RegularExpressions;

namespace Gordon360.Models.ViewModels;

public partial record ScheduleCourseViewModel
public record ScheduleCourseViewModel
{
public required string Code { get; set; }
public required string YearCode { get; set; }
Expand Down Expand Up @@ -54,7 +53,7 @@ public ScheduleCourseViewModel(ScheduleCourse course)
meetingDays.Add('U');
}

Code = RepeatedSpacesRegex().Replace(course.CRS_CDE.Trim(), " ");
Code = course.CRS_CDE;
YearCode = course.YR_CDE;
TermCode = course.TRM_CDE;
SubtermCode = course.SUBTERM_CDE;
Expand All @@ -72,7 +71,4 @@ public ScheduleCourseViewModel(ScheduleCourse course)
BeginDate = course.BeginDate;
EndDate = course.EndDate;
}

[GeneratedRegex("\\s+")]
private static partial Regex RepeatedSpacesRegex();
}

0 comments on commit f606b3c

Please sign in to comment.