Skip to content

Commit

Permalink
fix: 🐛 use prisma version 5.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dennemark committed Aug 9, 2024
1 parent 109885e commit 16f783f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
"author": "dennemark",
"license": "MIT",
"peerDependencies": {
"@prisma/client": "^5.17.0"
"@prisma/client": "^5.14.0"
},
"devDependencies": {
"@casl/ability": "^6.7.1",
"@casl/prisma": "^1.4.1",
"@prisma/client": "^5.17.0",
"@prisma/generator-helper": "^5.17.0",
"@prisma/client": "^5.14.0",
"@prisma/generator-helper": "^5.14.0",
"@release-it/conventional-changelog": "^8.0.1",
"@types/jest": "^29.5.12",
"@types/node": "^22.0.0",
"esbuild": "^0.23.0",
"jest": "^29.7.0",
"prisma": "^5.17.0",
"prisma": "^5.14.0",
"release-it": "^17.6.0",
"ts-jest": "^29.2.3",
"ts-node": "^10.9.2",
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 1 addition & 15 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ import { caslOperationDict, getFluentModel } from './helpers'

export { applyCaslToQuery }

type CaslExtensionType = DynamicClientExtensionThis<
Prisma.TypeMap<InternalArgs & {
result: {},
model: {},
query: {},
client: {}
}>,
Prisma.TypeMapCb,
{
result: {},
model: {},
query: {},
client: {}
}, {}>

/**
* enrich a prisma client to check for CASL abilities even in nested queries
Expand All @@ -47,7 +33,7 @@ export function useCaslAbilities(getAbilityFactory: () => AbilityBuilder<PureAbi
const ctx = Prisma.getExtensionContext(this)
// alter the getAblities function shortly
getAbilities = () => extendFactory(getAbilityFactory())
return ctx as CaslExtensionType
return ctx as typeof client
}
},
query: {
Expand Down

0 comments on commit 16f783f

Please sign in to comment.