mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 02:33:01 +00:00
avatar: new upload + remove avatar, and placeholder with colour and initials
This commit is contained in:
@@ -22,7 +22,7 @@ export async function updateById(
|
||||
updates: {
|
||||
name?: string;
|
||||
passwordHash?: string;
|
||||
avatarURL?: string;
|
||||
avatarURL?: string | null;
|
||||
},
|
||||
): Promise<UserRecord | undefined> {
|
||||
const [user] = await db.update(User).set(updates).where(eq(User.id, id)).returning();
|
||||
|
||||
@@ -18,7 +18,8 @@ export default async function update(req: AuthedRequest) {
|
||||
|
||||
const name = url.searchParams.get("name") || undefined;
|
||||
const password = url.searchParams.get("password") || undefined;
|
||||
const avatarURL = url.searchParams.get("avatarURL") || undefined;
|
||||
const avatarURL =
|
||||
url.searchParams.get("avatarURL") === "null" ? null : url.searchParams.get("avatarURL") || undefined;
|
||||
let passwordHash: string | undefined;
|
||||
if (password !== undefined) {
|
||||
passwordHash = await hashPassword(password);
|
||||
|
||||
Reference in New Issue
Block a user