mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
chore: feedback from pull request
This commit is contained in:
@ -80,7 +80,10 @@ export class LocalJobProvider extends BaseJobProvider {
|
||||
|
||||
public getApiHandler() {
|
||||
return async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (req.method === 'POST') {
|
||||
if (req.method !== 'POST') {
|
||||
res.status(405).send('Method not allowed');
|
||||
}
|
||||
|
||||
const jobId = req.headers['x-job-id'];
|
||||
const signature = req.headers['x-job-signature'];
|
||||
const isRetry = req.headers['x-job-retry'] !== undefined;
|
||||
@ -215,9 +218,6 @@ export class LocalJobProvider extends BaseJobProvider {
|
||||
}
|
||||
|
||||
res.status(200).send('OK');
|
||||
} else {
|
||||
res.status(405).send('Method not allowed');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -4,11 +4,11 @@ import { sendConfirmationToken } from '../../server-only/user/send-confirmation-
|
||||
import type { JobDefinition } from '../client/_internal/job';
|
||||
|
||||
export const SEND_CONFIRMATION_EMAIL_JOB_DEFINITION = {
|
||||
id: 'send.confirmation.email',
|
||||
id: 'send.signup.confirmation.email',
|
||||
name: 'Send Confirmation Email',
|
||||
version: '1.0.0',
|
||||
trigger: {
|
||||
name: 'send.confirmation.email',
|
||||
name: 'send.signup.confirmation.email',
|
||||
schema: z.object({
|
||||
email: z.string().email(),
|
||||
force: z.boolean().optional(),
|
||||
|
||||
@ -26,11 +26,11 @@ import { renderCustomEmailTemplate } from '../../utils/render-custom-email-templ
|
||||
import type { JobDefinition } from '../client/_internal/job';
|
||||
|
||||
export const SEND_SIGNING_EMAIL_JOB_DEFINITION = {
|
||||
id: 'send.signing.email',
|
||||
id: 'send.signing.requested.email',
|
||||
name: 'Send Signing Email',
|
||||
version: '1.0.0',
|
||||
trigger: {
|
||||
name: 'send.signing.email',
|
||||
name: 'send.signing.requested.email',
|
||||
schema: z.object({
|
||||
userId: z.number(),
|
||||
documentId: z.number(),
|
||||
|
||||
@ -109,7 +109,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
|
||||
DateTime.fromJSDate(mostRecentToken.createdAt).diffNow('minutes').minutes > -5
|
||||
) {
|
||||
await jobsClient.triggerJob({
|
||||
name: 'send.confirmation.email',
|
||||
name: 'send.signup.confirmation.email',
|
||||
payload: {
|
||||
email: user.email,
|
||||
},
|
||||
|
||||
@ -127,7 +127,7 @@ export const sendDocument = async ({
|
||||
}
|
||||
|
||||
await jobsClient.triggerJob({
|
||||
name: 'send.signing.email',
|
||||
name: 'send.signing.requested.email',
|
||||
payload: {
|
||||
userId,
|
||||
documentId,
|
||||
|
||||
@ -41,7 +41,7 @@ export const verifyEmail = async ({ token }: VerifyEmailProps) => {
|
||||
DateTime.now().minus({ hours: 1 }).toJSDate() > mostRecentToken.createdAt
|
||||
) {
|
||||
await jobsClient.triggerJob({
|
||||
name: 'send.confirmation.email',
|
||||
name: 'send.signup.confirmation.email',
|
||||
payload: {
|
||||
email: verificationToken.user.email,
|
||||
},
|
||||
|
||||
@ -53,7 +53,7 @@ export const authRouter = router({
|
||||
const user = await createUser({ name, email, password, signature, url });
|
||||
|
||||
await jobsClient.triggerJob({
|
||||
name: 'send.confirmation.email',
|
||||
name: 'send.signup.confirmation.email',
|
||||
payload: {
|
||||
email: user.email,
|
||||
},
|
||||
|
||||
@ -201,7 +201,7 @@ export const profileRouter = router({
|
||||
const { email } = input;
|
||||
|
||||
await jobsClient.triggerJob({
|
||||
name: 'send.confirmation.email',
|
||||
name: 'send.signup.confirmation.email',
|
||||
payload: {
|
||||
email,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user