From c40f155b59dac74631100be3de600de6241f0067 Mon Sep 17 00:00:00 2001 From: Roy Scheeren Date: Wed, 31 Jan 2024 20:27:37 +0100 Subject: [PATCH] fix(envited.ascs.digital): typing Signed-off-by: Roy Scheeren --- apps/envited.ascs.digital/common/guards/guards.ts | 6 +++--- .../common/serverActions/profiles/update.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/envited.ascs.digital/common/guards/guards.ts b/apps/envited.ascs.digital/common/guards/guards.ts index e0b9cc80..f2e0a428 100644 --- a/apps/envited.ascs.digital/common/guards/guards.ts +++ b/apps/envited.ascs.digital/common/guards/guards.ts @@ -1,4 +1,4 @@ -import { equals, pathOr, prop } from 'ramda' +import { equals, pathOr, prop, propOr } from 'ramda' import { Role, Session, User } from '../../common/types/types' @@ -12,7 +12,7 @@ export const isOwnUser = (user: User) => (session: Session) => export const userIsIssuedByLoggedInUser = (user: User) => (session: Session) => equals(prop('issuerId')(user))(pathOr('', ['user', 'pkh'])(session)) -export const isOwnProfile = (user: User) => (profile: { name: string }) => - equals(prop('name')(user))(prop('name')(profile)) +export const isOwnProfile = (user: User) => (profile: { name?: string }) => + equals(prop('name')(user))(propOr('', 'name')(profile)) export const isUsersCompanyProfile = isOwnProfile diff --git a/apps/envited.ascs.digital/common/serverActions/profiles/update.ts b/apps/envited.ascs.digital/common/serverActions/profiles/update.ts index 96a28677..72cb9fd4 100644 --- a/apps/envited.ascs.digital/common/serverActions/profiles/update.ts +++ b/apps/envited.ascs.digital/common/serverActions/profiles/update.ts @@ -11,7 +11,7 @@ import { badRequestError, error, unauthorizedError } from '../../utils' export const _update = ({ db, getServerSession }: { db: Database; getServerSession: () => Promise }) => - async (profile: Profile) => { + async (profile: Partial) => { try { const session = await getServerSession() if (isNil(session)) {