public virtual async Task <IActionResult> GetJobsForMe() { try { var userId = UserManager.GetUserId(User); var swabJobMatches = await SwabJobMatchService.GetJobMatchesForUserAsync(userId); return(Ok(swabJobMatches)); } catch (HttpStatusCodeException) { throw; } catch (Exception e) { throw new InternalServerErrorHttpException(e); } }
public async Task <IActionResult> Accept([FromBody] PrimitiveViewModel <int> jobId) { if (ModelState.IsValid) { try { var userId = UserManager.GetUserId(User); await SwabJobMatchService.AcceptJobAsync(jobId.Data, userId); return(Ok()); } catch (HttpStatusCodeException) { throw; } catch { throw new InternalServerErrorHttpException("Interner Serverfehler beim Akzeptieren einer Bewerbung."); } } return(BadRequest(ModelState)); }