Code Cleanup
This commit is contained in:
@@ -12,7 +12,7 @@ namespace BoredCareers.Controllers {
|
||||
|
||||
public AuthenticationController(DatabaseService db) : base(db) { }
|
||||
|
||||
[HttpPost("loginState")]
|
||||
[HttpPost("loginstate")]
|
||||
public ActionResult<Account> LoginState() {
|
||||
if (isLoggedIn()) {
|
||||
return Ok(getLoggedInUser());
|
||||
|
||||
@@ -35,8 +35,12 @@ namespace BoredCareers.Controllers {
|
||||
Company? test = await _databaseService.GetCompany(Convert.ToInt32(company.ID));
|
||||
if (test == null) {
|
||||
company.ID = await _databaseService.SetCompany(company);
|
||||
|
||||
|
||||
await _databaseService.SetEmployee(new Employee() {
|
||||
AccountID = getLoggedInUserID(),
|
||||
AccountName = getLoggedInUser().UserName,
|
||||
AccountEmail = getLoggedInUser().Email,
|
||||
Company = company
|
||||
});
|
||||
return Ok();
|
||||
@@ -66,7 +70,7 @@ namespace BoredCareers.Controllers {
|
||||
}
|
||||
|
||||
[HttpGet("sendverifyemail")]
|
||||
public async Task<ActionResult<string>> SendVerify([FromQuery] int CompanyID) {
|
||||
public async Task<ActionResult> SendVerify([FromQuery] int CompanyID) {
|
||||
try {
|
||||
string key = "v" + CompanyID;
|
||||
// Stop from sending multiple emails quickly
|
||||
@@ -99,7 +103,7 @@ namespace BoredCareers.Controllers {
|
||||
}
|
||||
|
||||
[HttpGet("verifyemail")]
|
||||
public async Task<ActionResult<bool>> VerifyEmail([FromQuery] int CompanyID, [FromQuery] string EmailToken) {
|
||||
public async Task<ActionResult> VerifyEmail([FromQuery] int CompanyID, [FromQuery] string EmailToken) {
|
||||
try {
|
||||
Company? test = await _databaseService.GetCompany(CompanyID);
|
||||
if (test != null) {
|
||||
|
||||
Reference in New Issue
Block a user