features/api-cleanup #15

Merged
jtom38 merged 13 commits from features/api-cleanup into main 2023-07-29 09:47:30 -07:00
Showing only changes of commit 7344d2bdd2 - Show all commits

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();
} }
} }