Skip to content

Commit dd41a4b

Browse files
committed
don't save empty strings
1 parent 51a0e55 commit dd41a4b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

BlazorDiffusion.ServiceInterface/CreativeService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,6 @@ public async Task Delete(HardDeleteCreative request)
540540
throw HttpError.NotFound($"Creative {request.Id} does not exist");
541541

542542
var artifacts = Db.Select<Artifact>(x => x.CreativeId == request.Id);
543-
544543
var artifactIds = artifacts.Select(x => x.Id).ToSet();
545544

546545
using var transaction = Db.OpenTransaction();

BlazorDiffusion.ServiceInterface/MyServices.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ public async Task<object> Any(UpdateUserProfile request)
5050
?? throw new Exception("File Upload Failed");
5151
request.Avatar = "/variants/width=128".CombineWith(publicPath);
5252
}
53+
54+
if (string.IsNullOrWhiteSpace(request.DisplayName))
55+
request.DisplayName = null;
56+
if (string.IsNullOrWhiteSpace(request.Handle))
57+
request.Handle = null;
58+
if (string.IsNullOrWhiteSpace(request.Avatar))
59+
request.Avatar = null;
5360

5461
await Db.UpdateOnlyAsync(() => new AppUser {
5562
DisplayName = request.DisplayName ?? userInfo.DisplayName,

0 commit comments

Comments
 (0)