(s3) Improve storage management and type safety

Closes #756
This commit is contained in:
Baptiste Arnaud
2023-09-08 15:28:11 +02:00
parent 43be38cf50
commit fbb198af9d
47 changed files with 790 additions and 128 deletions

View File

@@ -24,9 +24,7 @@ export const WorkspaceSettingsForm = ({ onClose }: { onClose: () => void }) => {
updateWorkspace({ name })
}
const handleChangeIcon = (icon: string) => {
updateWorkspace({ icon })
}
const handleChangeIcon = (icon: string) => updateWorkspace({ icon })
const handleDeleteClick = async () => {
await deleteCurrentWorkspace()
@@ -40,7 +38,10 @@ export const WorkspaceSettingsForm = ({ onClose }: { onClose: () => void }) => {
<Flex>
{workspace && (
<EditableEmojiOrImageIcon
uploadFilePath={`workspaces/${workspace.id}/icon`}
uploadFileProps={{
workspaceId: workspace.id,
fileName: 'icon',
}}
icon={workspace.icon}
onChangeIcon={handleChangeIcon}
boxSize="40px"

View File

@@ -4,7 +4,7 @@ export const isWriteWorkspaceForbidden = (
workspace: {
members: Pick<MemberInWorkspace, 'userId' | 'role'>[]
},
user: Pick<User, 'email' | 'id'>
user: Pick<User, 'id'>
) => {
const userRole = workspace.members.find(
(member) => member.userId === user.id