...
This commit is contained in:
@@ -404,6 +404,9 @@ public class DatabaseService : IDatabaseService
|
||||
|
||||
public async Task<OperationResult> SaveUserAsync(User user, bool isNew)
|
||||
{
|
||||
user.Username = user.Username?.Trim() ?? "";
|
||||
user.Password = user.Password?.Trim() ?? "";
|
||||
|
||||
if (string.IsNullOrWhiteSpace(user.Username))
|
||||
return OperationResult.Fail("Username is required.");
|
||||
if (string.IsNullOrWhiteSpace(user.Password))
|
||||
@@ -487,11 +490,13 @@ public class DatabaseService : IDatabaseService
|
||||
|
||||
public async Task<OperationResult> SaveCardNoteAsync(CardNote note, bool isNew)
|
||||
{
|
||||
note.CardName = note.CardName?.Trim() ?? "";
|
||||
note.Username = note.Username?.Trim() ?? "";
|
||||
note.Note = note.Note?.Trim() ?? "";
|
||||
|
||||
if (string.IsNullOrWhiteSpace(note.CardName))
|
||||
return OperationResult.Fail("Card name is required.");
|
||||
|
||||
note.Username ??= "";
|
||||
|
||||
try
|
||||
{
|
||||
await using var db = _configService.CreateDbContext();
|
||||
|
||||
Reference in New Issue
Block a user