Files
speckle-server/packages/server/modules/comments/authz/loaders/index.ts
T
Kristaps Fabians Geikins b6c21fd506 feat: comment read/write auth policies in BE & FE (#4368)
* webhooks perm minor fix

* tryna get fileimport service to work

* new comment policies - shared

* BE done?

* checks implemented in FE

* lint fix

* tests fix

* readme fix
2025-04-10 15:14:34 +03:00

20 lines
540 B
TypeScript

import { defineModuleLoaders } from '@/modules/loaders'
import { getProjectDbClient } from '@/modules/multiregion/utils/dbSelector'
export default defineModuleLoaders(async () => {
return {
getComment: async ({ commentId, projectId }, { dataLoaders }) => {
const db = await getProjectDbClient({ projectId })
const comment = await dataLoaders
.forRegion({ db })
.comments.getComment.load(commentId)
if (!comment) return null
return {
...comment,
projectId
}
}
}
})