Skip to content

Commit

Permalink
Merge pull request #232 from ksprabin/feature/dfa_cleanup
Browse files Browse the repository at this point in the history
Feature/dfa cleanup
  • Loading branch information
ksprabin authored Oct 13, 2023
2 parents 8afea7a + eb6737f commit 4226fc7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dfa/src/API/EMBC.DFA.API/Controllers/EligibilityController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using EMBC.DFA.API.ConfigurationModule.Models.Dynamics;
using EMBC.Utilities.Messaging;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Hosting;
Expand All @@ -16,6 +17,7 @@ namespace EMBC.DFA.API.Controllers
{
[Route("api/eligibility")]
[ApiController]
[EnableCors("AllowCors")]
public class EligibilityController : ControllerBase
{
private readonly IConfigurationHandler handler;
Expand All @@ -37,6 +39,7 @@ public EligibilityController(
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[AllowAnonymous]
public async Task<ActionResult<bool>> GetEvents()
{
var result = await handler.HandleEvents();
Expand Down
7 changes: 6 additions & 1 deletion landing-page/src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,12 @@
<script type="text/javascript">
var apiUrl = 'https://dfa-portal-dev.apps.silver.devops.gov.bc.ca/api/eligibility/checkEventsAvailable';

fetch(apiUrl).then(response => {
fetch(apiUrl, {
method: "GET", mode: 'cors', headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*'
}
}).then(response => {
return response.json();
}).then(data => {

Expand Down

0 comments on commit 4226fc7

Please sign in to comment.