Skip to content

Commit 588c136

Browse files
MartinSchoelerggazzo
authored andcommitted
chore!: remove deprecated sendConfirmationEmail method (#36829)
1 parent bd17f08 commit 588c136

File tree

4 files changed

+9
-14
lines changed

4 files changed

+9
-14
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@rocket.chat/meteor": major
3+
"@rocket.chat/web-ui-registration": major
4+
---
5+
6+
Removes the deprecated sendConfirmationEmail method

apps/meteor/server/methods/sendConfirmationEmail.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
import type { ServerMethods } from '@rocket.chat/ddp-client';
21
import { Users } from '@rocket.chat/models';
32
import { Accounts } from 'meteor/accounts-base';
43
import { check } from 'meteor/check';
54
import { DDPRateLimiter } from 'meteor/ddp-rate-limiter';
65
import { Meteor } from 'meteor/meteor';
76

8-
import { methodDeprecationLogger } from '../../app/lib/server/lib/deprecationWarningLogger';
9-
107
export const sendConfirmationEmail = async (to: string): Promise<boolean> => {
118
check(to, String);
129

@@ -29,14 +26,6 @@ export const sendConfirmationEmail = async (to: string): Promise<boolean> => {
2926
}
3027
};
3128

32-
Meteor.methods<ServerMethods>({
33-
async sendConfirmationEmail(to) {
34-
methodDeprecationLogger.method('sendConfirmationEmail', '7.0.0', '/v1/users.sendConfirmationEmail');
35-
36-
return sendConfirmationEmail(to);
37-
},
38-
});
39-
4029
DDPRateLimiter.addRule(
4130
{
4231
type: 'method',

packages/web-ui-registration/src/EmailConfirmationForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const EmailConfirmationForm = ({ email, onBackToLogin }: { email?: string
3232
if (sendEmail.isPending) {
3333
return;
3434
}
35-
sendEmail.mutate(data.email);
35+
sendEmail.mutate({ email: data.email });
3636
})}
3737
>
3838
<Form.Header>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { useMethod } from '@rocket.chat/ui-contexts';
1+
import { useEndpoint } from '@rocket.chat/ui-contexts';
22
import { useMutation } from '@tanstack/react-query';
33

44
export const useLoginSendEmailConfirmation = () => {
55
return useMutation({
6-
mutationFn: useMethod('sendConfirmationEmail'),
6+
mutationFn: useEndpoint('POST', '/v1/users.sendConfirmationEmail'),
77
});
88
};

0 commit comments

Comments
 (0)