Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
intrn(chat message): validate the IDs that belongs to current user
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Sep 13, 2022
1 parent adc82d7 commit 0180430
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion routes/api/chat_message/list.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { auditTrail as permissionGroup } from "$/permissions/permission_list"
import required from "!/validators/base/required"
import makeListRules from "!/rule_sets/make_list"
import makeMultiIDBasedFilterRules from "!/rule_sets/make_multi-id-based_filter"
import doesBelongToCurrentUser from "!/validators/manager/does_belong_to_user"

export default class extends QueryController {
get filePath(): string { return __filename }
Expand All @@ -29,7 +30,10 @@ export default class extends QueryController {
...makeMultiIDBasedFilterRules(Manager, {
"initialPipes": [ required ],
"multipleIDKey": "consultationIDs",
"mustCast": true
"mustCast": true,
"postIDRules": {
"pipes": [ doesBelongToCurrentUser ]
}
})
}, {
"defaultSortColumn": "-createdAt"
Expand Down

0 comments on commit 0180430

Please sign in to comment.