Last active
March 14, 2019 18:29
-
-
Save gzamudio/4779860b6a8093f2ed50fa03d2a22fca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<IActionResult> CategoryMetric(string startingDate, int? schoolId) | |
{ | |
var currentUser = (await UserManager.FindByEmailAsync(User.Identity.Name)); | |
try | |
{ | |
if (GetSchoolToSearch(currentUser, schoolId) == null && !currentUser.IsInRole("Admin")) | |
return BadRequest(Localizer["UserIsNotSchoolGroupAdmin"]); | |
return Ok(GetSchoolGroupAccesedResources(schoolId, | |
currentUser.SchoolGroup, DateTime.ParseExact(startingDate, | |
"dd/MM/yyyy", | |
CultureInfo.InvariantCulture))); | |
} | |
catch (NullReferenceException) | |
{ | |
return BadRequest(Localizer["UserDoesNotBelongToASchool"]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment