mirror of https://github.com/hykilpikonna/AquaDX
[+] Add profile picture field to aqua net user
parent
441d7376cb
commit
68626fecd7
|
@ -208,7 +208,11 @@ class UserRegistrar(
|
||||||
if (!mime.startsWith("image/")) 400 - "Invalid file type"
|
if (!mime.startsWith("image/")) 400 - "Invalid file type"
|
||||||
|
|
||||||
// Save the image
|
// 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
|
SUCCESS
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ class AquaNetUser(
|
||||||
// Profile fields
|
// Profile fields
|
||||||
var profileLocation: String = "",
|
var profileLocation: String = "",
|
||||||
var profileBio: String = "",
|
var profileBio: String = "",
|
||||||
|
var profilePicture: String = "",
|
||||||
|
|
||||||
// Email confirmation
|
// Email confirmation
|
||||||
var emailConfirmed: Boolean = false,
|
var emailConfirmed: Boolean = false,
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE aqua_net_user ADD profile_picture VARCHAR(255) NULL;
|
Loading…
Reference in New Issue