fix: use strict equality in webhook delete handler role check (#28958)
Replaced `==` with `===` for the ADMIN role comparison to follow TypeScript best practices and match the project's coding conventions. Co-authored-by: Test User <[email protected]> Co-authored-by: Claude Opus 4.7 <[email protected]>
This commit is contained in:
1 file changed
+1
-1
@@ -20,7 +20,7 @@ export const deleteHandler = async ({ ctx, input }: DeleteOptions) => {
|
||||
if (Array.isArray(where.AND)) {
|
||||
if (input.eventTypeId) {
|
||||
where.AND.push({ eventTypeId: input.eventTypeId });
|
||||
} else if (ctx.user.role == "ADMIN") {
|
||||
} else if (ctx.user.role === "ADMIN") {
|
||||
where.AND.push({ OR: [{ platform: true }, { userId: ctx.user.id }] });
|
||||
} else {
|
||||
where.AND.push({ userId: ctx.user.id });
|
||||
|
||||
Reference in new issue
Block a user