diff --git a/apps/envited.ascs.digital/common/serverActions/profiles/update.test.ts b/apps/envited.ascs.digital/common/serverActions/profiles/update.test.ts index ed87458c..34d8c09e 100644 --- a/apps/envited.ascs.digital/common/serverActions/profiles/update.test.ts +++ b/apps/envited.ascs.digital/common/serverActions/profiles/update.test.ts @@ -19,7 +19,9 @@ describe('serverActions/profiles/update', () => { } as any const user = { - name: 'USER_NAME', + user: { + name: 'USER_NAME', + }, profile: { name: 'USER_NAME', }, @@ -52,7 +54,9 @@ describe('serverActions/profiles/update', () => { } as any const user = { - name: 'USER_NAME', + user: { + name: 'USER_NAME', + }, profile: { name: 'USER_NAME', }, diff --git a/apps/envited.ascs.digital/common/serverActions/profiles/update.ts b/apps/envited.ascs.digital/common/serverActions/profiles/update.ts index 4d0f8a5d..fbeb42f7 100644 --- a/apps/envited.ascs.digital/common/serverActions/profiles/update.ts +++ b/apps/envited.ascs.digital/common/serverActions/profiles/update.ts @@ -40,7 +40,7 @@ export const _update = }) } - if (!isOwnProfile(user)(profile)) { + if (!isOwnProfile(user.user)(profile)) { throw forbiddenError({ resource: 'profiles', resourceId: profile.id, diff --git a/apps/envited.ascs.digital/modules/HeroHeader/HeroHeader.tsx b/apps/envited.ascs.digital/modules/HeroHeader/HeroHeader.tsx index 03ec1221..42c99d5b 100644 --- a/apps/envited.ascs.digital/modules/HeroHeader/HeroHeader.tsx +++ b/apps/envited.ascs.digital/modules/HeroHeader/HeroHeader.tsx @@ -36,9 +36,11 @@ export const HeroHeader: FC = () => { const user = await insertUser(USER_CREDENTIAL) if (user) { setMessage(`Added ${user.id} as User`) + success('User added') } - } catch (error) { - console.log(error) + } catch (e) { + error('Something went wrong') + console.log(e) } } @@ -46,6 +48,7 @@ export const HeroHeader: FC = () => { try { await insertUser(INVALID_USER_CREDENTIAL) } catch (error: any) { + error('Something went wrong') setMessage(error.message) } } @@ -53,7 +56,9 @@ export const HeroHeader: FC = () => { const update = async () => { try { await updateProfile({ name: 'Testcompany GmbH', description: 'test description' }) + success('Profile updated') } catch (error: any) { + error('Something went wrong') setMessage(error.message) } } diff --git a/apps/envited.ascs.digital/modules/Users/Users.tsx b/apps/envited.ascs.digital/modules/Users/Users.tsx index dd343e33..572f7e01 100644 --- a/apps/envited.ascs.digital/modules/Users/Users.tsx +++ b/apps/envited.ascs.digital/modules/Users/Users.tsx @@ -2,7 +2,7 @@ import { Card, Heading, Table, TableBody, TableCell, TableHeader, TableRow } from '@envited-marketplace/design-system' import { TrashIcon } from '@heroicons/react/24/outline' -import { has, map } from 'ramda' +import { map } from 'ramda' import React, { FC } from 'react' import { useTranslation } from '../../common/i18n'