-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update scam detection #1079
Update scam detection #1079
Conversation
danielailie
commented
Sep 19, 2024
•
edited
Loading
edited
- add endpoint for admin to trigger scam update for certain collection
- add rabbit queue where an event will be posted after the endpoint gets call
- add consumer that will mark or clear the scam based on the input
@@ -157,4 +160,11 @@ export class AdminOperationsResolver { | |||
}); | |||
return true; | |||
} | |||
|
|||
@Mutation(() => Boolean) | |||
@UseGuards(JwtOrNativeAuthGuard, GqlAdminAuthGuard) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
|
||
export enum ScamInputEnum { | ||
deny = 'deny', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use PascalCase for enums (if applicable)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to keep them like this here because of mongo
async consumeScamEvents(event: MarkScamCollectionEvent) { | ||
if (event.type === ScamInputEnum.allow) { | ||
await this.collectionScamService.manuallyClearCollectionScamInfo(event.collectionIdentifier) | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could have also been "else if" for "deny", and throw error (unrecognized) on "else".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to let it like this because are only two possibilities and in the future if we add another one then update the condition 🙏