From e0c2079db853bb566a01977bcb2bf7253a357dd3 Mon Sep 17 00:00:00 2001 From: Eddie Date: Wed, 27 Nov 2024 22:36:26 +0330 Subject: [PATCH] prioritizing readability --- EWallet.Api/Currencies/EndPoints/CurrencyEndPoints.cs | 6 +++--- EWallet.Api/Wallets/EndPoints/WalletEndPoints.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/EWallet.Api/Currencies/EndPoints/CurrencyEndPoints.cs b/EWallet.Api/Currencies/EndPoints/CurrencyEndPoints.cs index dc25c8b..e505ad3 100644 --- a/EWallet.Api/Currencies/EndPoints/CurrencyEndPoints.cs +++ b/EWallet.Api/Currencies/EndPoints/CurrencyEndPoints.cs @@ -20,9 +20,9 @@ public static void MapCurrencyEndpoints(this WebApplication app) } catch (Exception e) { - return e.InnerException!.Message.Contains("duplicate") - ? Results.Conflict(ErrorMessages.DuplicateInput) - : Results.BadRequest(StatusCodes.Status500InternalServerError); + if (e.InnerException!.Message.Contains("duplicate")) + return Results.Conflict(ErrorMessages.DuplicateInput); + return Results.BadRequest(StatusCodes.Status500InternalServerError); } }).AllowAnonymous(); } diff --git a/EWallet.Api/Wallets/EndPoints/WalletEndPoints.cs b/EWallet.Api/Wallets/EndPoints/WalletEndPoints.cs index 32b4b29..25f8239 100644 --- a/EWallet.Api/Wallets/EndPoints/WalletEndPoints.cs +++ b/EWallet.Api/Wallets/EndPoints/WalletEndPoints.cs @@ -20,9 +20,9 @@ public static void MapWalletsEndpoints(this WebApplication app) } catch (Exception e) { - return e.InnerException!.Message.Contains("duplicate") - ? Results.Conflict(ErrorMessages.DuplicateInput) - : Results.BadRequest(StatusCodes.Status500InternalServerError); + if (e.InnerException!.Message.Contains("duplicate")) + return Results.Conflict(ErrorMessages.DuplicateInput); + return Results.BadRequest(StatusCodes.Status500InternalServerError); } }).AllowAnonymous(); }