Switch src & dst and remove some no longer needed code

This commit is contained in:
Amelia 2025-05-08 09:23:48 +02:00
parent 9844503671
commit a01f656654
No known key found for this signature in database
GPG key ID: D6D0ECE365407EAA
7 changed files with 13 additions and 40 deletions

View file

@ -59,16 +59,6 @@ public class PersonController : BaseApiController
return Ok(await _unitOfWork.PersonRepository.GetRolesForPersonByName(personId, User.GetUserId()));
}
[HttpGet("aliases")]
public async Task<ActionResult<IList<string>>> GetAliasesForPerson([FromQuery] int personId)
{
var person = await _unitOfWork.PersonRepository.GetPersonById(personId);
if (person == null) return NotFound();
if (person.Aliases == null || person.Aliases.Count == 0) return new List<string>();
return Ok(person.Aliases.Select(a => a.Alias).ToList());
}
/// <summary>
/// Returns a list of authors and artists for browsing
@ -207,7 +197,7 @@ public class PersonController : BaseApiController
var src = await _unitOfWork.PersonRepository.GetPersonById(dto.SrcId, PersonIncludes.All);
if (src == null) return BadRequest();
await _personService.MergePeopleAsync(dst, src);
await _personService.MergePeopleAsync(src, dst);
await _eventHub.SendMessageAsync(MessageFactory.PersonMerged, MessageFactory.PersonMergedMessage(dst, src));
return Ok(_mapper.Map<PersonDto>(dst));