fix(manager): review remediation — DeleteTrackAsync dead code, TrackEdit Id long, dead @using
This commit is contained in:
@@ -142,17 +142,18 @@ public class CmsTrackService : ICmsTrackService
|
||||
var lookup = await _trackService.GetById(id);
|
||||
if (!lookup.Success)
|
||||
{
|
||||
var error = lookup.Messages.FirstOrDefault()?.Message;
|
||||
_logger.LogError("CMS delete: lookup failed for track {TrackId}: {Error}", id, error);
|
||||
var error = lookup.Messages.FirstOrDefault()?.Message ?? "unknown error";
|
||||
_logger.LogError("CMS delete: GetById threw for track {TrackId}: {Error}", id, error);
|
||||
return Result.CreateFailResult("Failed to load track.");
|
||||
}
|
||||
|
||||
var track = lookup.Value;
|
||||
if (track is null)
|
||||
if (lookup.Value is null)
|
||||
{
|
||||
return Result.CreateFailResult("Track not found.");
|
||||
}
|
||||
|
||||
var track = lookup.Value;
|
||||
|
||||
var entryKey = track.EntryKey;
|
||||
|
||||
// 2. SQL delete. On failure, do NOT touch the vault — nothing to clean up.
|
||||
|
||||
Reference in New Issue
Block a user