const filename = `${id}-${file.name}`.replaceAll(/[^a-zA-Z0-9.]/g, '-')
const objectName = `notes/${getConfig().ROOM_NAME}/${filename}`
const response = await fetch('/api/upload', {
method: 'POST',
body: JSON.stringify({ objectName }),
})
const { url } = await response.json()
const result = await fetch(url, {
method: 'PUT',
body: file,
})
const filename = `${id}-${file.name}`.replaceAll(/[^a-zA-Z0-9.]/g, '-')
const objectName = `notes/${getConfig().ROOM_NAME}/${filename}`
const response = await fetch('/api/upload', {
method: 'POST',
body: JSON.stringify({ objectName }),
})
const { url } = await response.json()
const result = await fetch(url, {
method: 'PUT',
body: file,
})