update: change save user avatar
This commit is contained in:
@@ -35,8 +35,7 @@ export async function onRequestPut(context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Upload the avatar to R2
|
// Upload the avatar to R2
|
||||||
const fileExtension = fileTypeResult.ext;
|
const objectName = `avatars/${context.user.userId}`;
|
||||||
const objectName = `avatars/${context.user.userId}.${fileExtension}`;
|
|
||||||
await env.MY_BUCKET.put(objectName, buffer);
|
await env.MY_BUCKET.put(objectName, buffer);
|
||||||
|
|
||||||
// Store the filename in D1
|
// Store the filename in D1
|
||||||
|
|||||||
Reference in New Issue
Block a user