CodeProjectController.cs was updated to support ActionResults and new route

This commit is contained in:
James Tombleson 2023-07-23 22:56:26 -07:00
parent 19d8e3e925
commit 7344d2bdd2
1 changed files with 5 additions and 3 deletions

View File

@ -7,10 +7,10 @@ using Newsbot.Collector.Api.Domain;
using Newsbot.Collector.Domain.Models.Config; using Newsbot.Collector.Domain.Models.Config;
using Newsbot.Collector.Services.Jobs; using Newsbot.Collector.Services.Jobs;
namespace Newsbot.Collector.Api.Controllers; namespace Newsbot.Collector.Api.Controllers.v1;
[ApiController] [ApiController]
[Route("api/codeprojects")] [Route("api/v1/codeprojects")]
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
public class CodeProjectController public class CodeProjectController
{ {
@ -26,7 +26,7 @@ public class CodeProjectController
[HttpPost("check")] [HttpPost("check")]
[Authorize(Roles = Authorization.AdministratorsRole)] [Authorize(Roles = Authorization.AdministratorsRole)]
public void PullNow() public ActionResult PullNow()
{ {
BackgroundJob.Enqueue<CodeProjectWatcherJob>(x => x.InitAndExecute(new CodeProjectWatcherJobOptions BackgroundJob.Enqueue<CodeProjectWatcherJob>(x => x.InitAndExecute(new CodeProjectWatcherJobOptions
{ {
@ -34,5 +34,7 @@ public class CodeProjectController
FeaturePullReleases = true, FeaturePullReleases = true,
FeaturePullCommits = true FeaturePullCommits = true
})); }));
return new AcceptedResult();
} }
} }