Skip to content

Commit

Permalink
Added PreferredContact to the API for getting a resident's RA
Browse files Browse the repository at this point in the history
  • Loading branch information
RossClark01 committed Dec 5, 2024
1 parent 95144e6 commit e04dd63
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Gordon360/Models/ViewModels/Housing/RA_StudentsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ public class RA_StudentsViewModel
public string PhoneNumber { get; set; }
public string ID { get; set; }
public string PhotoURL { get; set; }
}
public string PreferredContact { get; set; }
}
4 changes: 2 additions & 2 deletions Gordon360/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"Development": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "https://localhost:51645/swagger",
"launchUrl": "https://localhost:51659/swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sqlDebugging": true,
"applicationUrl": "https://localhost:51645;http://localhost:51644"
"applicationUrl": "https://localhost:51659;http://localhost:51660"
},
"Train": {
"commandName": "Project",
Expand Down
6 changes: 6 additions & 0 deletions Gordon360/Services/HousingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,12 @@ public async Task<RA_StudentsViewModel> GetResidentRAAsync(string hallId, string
throw new InvalidOperationException("RA details could not be retrieved.");
}

// Fetch the preferred contact method for the RA
var preferredContact = await GetPreferredContactAsync(assignedRA.ID);

// Include the preferred contact in the returned model
assignedRA.PreferredContact = preferredContact;

return assignedRA;
}

Expand Down

0 comments on commit e04dd63

Please sign in to comment.