Skip to content

Commit

Permalink
fix(envited.ascs.digital): typing (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
royscheeren authored Jan 31, 2024
2 parents 41fa1cf + c40f155 commit 1c518a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/envited.ascs.digital/common/guards/guards.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { badRequestError, error, unauthorizedError } from '../../utils'

export const _update =
({ db, getServerSession }: { db: Database; getServerSession: () => Promise<Session | null> }) =>
async (profile: Profile) => {
async (profile: Partial<Profile>) => {
try {
const session = await getServerSession()
if (isNil(session)) {
Expand Down

0 comments on commit 1c518a0

Please sign in to comment.