update: change save user avatar
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user