diff --git a/SS14.MapServer/Controllers/MapController.cs b/SS14.MapServer/Controllers/MapController.cs index 838136c..cb25542 100644 --- a/SS14.MapServer/Controllers/MapController.cs +++ b/SS14.MapServer/Controllers/MapController.cs @@ -209,6 +209,35 @@ public async Task SyncMaps(List? mapFileNames, bool syncA return Ok(); } + [HttpPost("syncall")] + [Consumes("application/json")] + public async Task SyncAllMaps() + { + var data = new JobDataMap + { + {Jobs.SyncMaps.MapListKey, new List() }, + {Jobs.SyncMaps.SyncAllKey, true} + }; + + await _schedulingService.RunJob(nameof(Jobs.SyncMaps), "Sync", data); + return Ok(); + } + + [HttpPost("sync/{gitRef}")] + [Consumes("application/json")] + public async Task SyncMaps(string gitRef, bool syncAll) + { + var data = new JobDataMap + { + {Jobs.SyncMaps.MapListKey, new List() }, + {Jobs.SyncMaps.SyncAllKey, syncAll}, + {Jobs.SyncMaps.GitRefKey, gitRef} + }; + + await _schedulingService.RunJob(nameof(Jobs.SyncMaps), "Sync", data); + return Ok(); + } + private bool ValidateMapRequest(Map map, ICollection images, [NotNullWhen(true)] out BadRequestObjectResult? error) { //Ensure map id is lowercase diff --git a/SS14.MapServer/SS14.MapServer.csproj b/SS14.MapServer/SS14.MapServer.csproj index a52e6f5..47a244f 100644 --- a/SS14.MapServer/SS14.MapServer.csproj +++ b/SS14.MapServer/SS14.MapServer.csproj @@ -5,7 +5,7 @@ enable enable Linux - 1.1.6 + 1.1.7