refactor(api): Vereinfachung der GetCurrentAsync-Methode im EnvelopeController

This commit is contained in:
Developer 02
2024-09-05 10:35:35 +02:00
parent 5b8d8b9e55
commit b8b09ded5d

View File

@@ -24,9 +24,7 @@ namespace EnvelopeGenerator.GeneratorAPI.Controllers
{ {
try try
{ {
var id = User.GetId(); if (User.GetId() is int intId)
if (id is int intId)
return await _envelopeService.ReadByIdAsync(intId).ThenAsync( return await _envelopeService.ReadByIdAsync(intId).ThenAsync(
Success: Ok, Success: Ok,
Fail: IActionResult (msg, ntc) => Fail: IActionResult (msg, ntc) =>