public IActionResult Edit(Script script) { script.Author = User?.Identity?.Name; script.LastModified = DateTime.Now; if (script.Id == null) { _service.Create(script); } else { _service.Update(script); } return(Redirect("/script")); }
public async Task <IActionResult> UpdateScript(ScriptDto script, CancellationToken cancellationToken) { return(Ok(await _service.Update(script, HttpContext.GetCurrentUserId(), cancellationToken))); }