🐛 Bug fixes
This commit is contained in:
parent
fa42ea67ac
commit
c901781323
@ -82,6 +82,8 @@ public class AccountController(AppDatabase db) : ControllerBase
|
||||
|
||||
var account = await db.Accounts
|
||||
.Include(e => e.Profile)
|
||||
.Include(e => e.Profile.Picture)
|
||||
.Include(e => e.Profile.Background)
|
||||
.Where(e => e.Id == userId)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
@ -155,6 +157,7 @@ public class AccountController(AppDatabase db) : ControllerBase
|
||||
|
||||
picture.UsedCount++;
|
||||
profile.Picture = picture;
|
||||
db.Update(picture);
|
||||
}
|
||||
|
||||
if (request.BackgroundId is not null)
|
||||
@ -169,8 +172,10 @@ public class AccountController(AppDatabase db) : ControllerBase
|
||||
|
||||
background.UsedCount++;
|
||||
profile.Background = background;
|
||||
db.Update(background);
|
||||
}
|
||||
|
||||
db.Update(profile);
|
||||
await db.SaveChangesAsync();
|
||||
return profile;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using NodaTime;
|
||||
|
||||
namespace DysonNetwork.Sphere.Storage;
|
||||
|
Loading…
x
Reference in New Issue
Block a user