This commit is contained in:
@@ -230,6 +230,9 @@ namespace AyaNova.Api.Controllers
|
||||
j.Name = "TestWidgetJob";
|
||||
j.JobType = JobType.TestWidgetJob;
|
||||
await JobsBiz.AddJobAsync(j, ct);
|
||||
//Log
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.ServerJob, AyaEvent.Created, $"{j.JobType} {j.Name}"), ct);
|
||||
|
||||
return Accepted(new { JobId = j.GId });//202 accepted
|
||||
}
|
||||
|
||||
|
||||
@@ -141,8 +141,7 @@ namespace AyaNova.Biz
|
||||
/// <param name="ct"></param>
|
||||
/// <returns></returns>
|
||||
internal static async Task<OpsJob> AddJobAsync(OpsJob newJob, AyContext ct)
|
||||
{
|
||||
//TODO: Does this need to create an event so we know which user created the job?
|
||||
{
|
||||
await ct.OpsJob.AddAsync(newJob);
|
||||
await ct.SaveChangesAsync();
|
||||
return newJob;
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using EnumsNET;
|
||||
using AyaNova.Util;
|
||||
using AyaNova.Api.ControllerHelpers;
|
||||
using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user