b6c21fd506
* 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
20 lines
540 B
TypeScript
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
|
|
}
|
|
}
|
|
}
|
|
})
|