This commit is contained in:
2020-05-16 15:46:05 +00:00
parent 6f0182042e
commit a2498a1800
4 changed files with 87 additions and 6 deletions

View File

@@ -94,9 +94,7 @@ namespace AyaNova.Api.Controllers
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "List of ids"));
tag = TagUtil.NormalizeTag(tag);
if (string.IsNullOrWhiteSpace(tag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "tag"));
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "tag"));
var JobName = $"BulkAdd tag {tag} to {ayaType} ({idList.Count} specified)";
JObject o = JObject.FromObject(new
{
@@ -107,11 +105,11 @@ namespace AyaNova.Api.Controllers
});
OpsJob j = new OpsJob();
j.Name = $"BulkTag";
j.Name = JobName;
j.JobType = JobType.BulkTag;
j.Exclusive = false;
j.JobInfo = o.ToString();
// await JobsBiz.AddJobAsync(j, ct);
await JobsBiz.AddJobAsync(j, ct);
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserIdFromContext.Id(HttpContext.Items), 0, ayaType, AyaEvent.Created, JobName), ct);
return Accepted(new { JobId = j.GId });
}