[+] Add profile picture field to aqua net user

This commit is contained in:
Azalea
2024-03-05 17:59:44 -05:00
parent 441d7376cb
commit 68626fecd7
3 changed files with 7 additions and 1 deletions

View File

@@ -208,7 +208,11 @@ class UserRegistrar(
if (!mime.startsWith("image/")) 400 - "Invalid file type"
// Save the image
(portraitPath / "${u.auId}.${MIMES.forName(mime)?.extension ?: "jpg"}").writeBytes(bytes)
val name = "${u.auId}.${MIMES.forName(mime)?.extension ?: "jpg"}"
async {
(portraitPath / name).writeBytes(bytes)
userRepo.save(u.apply { profilePicture = name })
}
SUCCESS
}