update: change save user avatar

This commit is contained in:
Tony Yang
2025-04-15 10:27:25 +08:00
parent 39244b64a5
commit 7e2bbb143f
+1 -2
View File
@@ -35,8 +35,7 @@ export async function onRequestPut(context) {
}
// Upload the avatar to R2
const fileExtension = fileTypeResult.ext;
const objectName = `avatars/${context.user.userId}.${fileExtension}`;
const objectName = `avatars/${context.user.userId}`;
await env.MY_BUCKET.put(objectName, buffer);
// Store the filename in D1