fix: Handle base64 and remote images when creating a file (#5740)

This commit is contained in:
Tom Moor
2023-08-26 09:15:14 -04:00
committed by GitHub
parent c643f62d96
commit 78ad1b867a
15 changed files with 292 additions and 198 deletions

View File

@@ -20,14 +20,14 @@ export default class UploadTeamAvatarTask extends BaseTask<Props> {
rejectOnEmpty: true,
});
const avatarUrl = await FileStorage.uploadFromUrl(
const res = await FileStorage.uploadFromUrl(
props.avatarUrl,
`avatars/${team.id}/${uuidv4()}`,
"public-read"
);
if (avatarUrl) {
await team.update({ avatarUrl });
if (res?.url) {
await team.update({ avatarUrl: res?.url });
}
}