global: minor refactoring

This commit is contained in:
Abdullah Atta
2024-03-05 10:07:01 +05:00
parent 4da9614851
commit 29eedd57e8
3 changed files with 5 additions and 3 deletions

View File

@@ -78,6 +78,8 @@ namespace Notesnook.API.Controllers
if (user.AttachmentsKey != null)
await UserService.SetUserAttachmentsKeyAsync(response.UserId, user.AttachmentsKey);
else if (user.Profile != null)
await UserService.SetUserProfileAsync(response.UserId, user.Profile);
else return BadRequest();
return Ok();
@@ -102,7 +104,7 @@ namespace Notesnook.API.Controllers
if (await UserService.DeleteUserAsync(userId, User.FindFirstValue("jti")))
{
Response response = await this.httpClient.ForwardAsync<Response>(this.HttpContextAccessor, $"{Servers.IdentityServer.ToString()}/account/unregister", HttpMethod.Post);
Response response = await this.httpClient.ForwardAsync<Response>(HttpContextAccessor, $"{Servers.IdentityServer}/account/unregister", HttpMethod.Post);
if (!response.Success) return BadRequest();
return Ok();

View File

@@ -51,7 +51,7 @@ namespace Streetwriters.Data.DbContexts
using (IClientSessionHandle session = await MongoClient.StartSessionAsync())
{
#if DEBUG
await Task.WhenAll(_commands.Select(c => c(session, default(CancellationToken))));
await Task.WhenAll(_commands.Select(c => c(session, default)));
#else
await session.WithTransactionAsync(async (handle, token) =>
{

View File

@@ -10,7 +10,7 @@ namespace Streetwriters.Identity.Services
public class EmailAddressValidator
{
private static DateTimeOffset LAST_FETCH_TIME = DateTimeOffset.MinValue;
private static HashSet<string> BLACKLISTED_DOMAINS = new HashSet<string>();
private static HashSet<string> BLACKLISTED_DOMAINS = new();
public static async Task<bool> IsEmailAddressValidAsync(string email)
{