Skip to content

Commit 4caa929

Browse files
committed
Fixed issue with storing wallet when null, syntax error fixed
1 parent 0ee8877 commit 4caa929

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

backend/src/lib/job.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const sendClaimEmails = async (job: JobType, mysql: MySql) => {
121121
);
122122

123123
updates.push(
124-
`(${currentUser.id}, '${currentUser.email}', ${res ? AirdropStatus.EMAIL_SENT : AirdropStatus.EMAIL_ERROR}, '${dateToSqlString(new Date())}', '${currentUser.wallet}')`,
124+
`(${currentUser.id}, '${currentUser.email}', ${res ? AirdropStatus.EMAIL_SENT : AirdropStatus.EMAIL_ERROR}, '${dateToSqlString(new Date())}', ${currentUser.wallet ? `'${currentUser.wallet}'` : 'NULL'})`,
125125
);
126126
} else if (currentUser.wallet) {
127127
try {
@@ -132,11 +132,11 @@ const sendClaimEmails = async (job: JobType, mysql: MySql) => {
132132

133133
if (mintResponse.success) {
134134
updates.push(
135-
`(${currentUser.id}, '${currentUser.email}', ${AirdropStatus.AIRDROP_COMPLETED}, null, '${currentUser.wallet}')`,
135+
`(${currentUser.id}, '${currentUser.email}', ${AirdropStatus.AIRDROP_COMPLETED}, NULL, '${currentUser.wallet}')`,
136136
);
137137
} else {
138138
updates.push(
139-
`(${currentUser.id}, '${currentUser.email}', ${AirdropStatus.AIRDROP_ERROR}, null, '${currentUser.wallet}')`,
139+
`(${currentUser.id}, '${currentUser.email}', ${AirdropStatus.AIRDROP_ERROR}, NULL, '${currentUser.wallet}')`,
140140
);
141141
}
142142
} catch (e) {
@@ -149,7 +149,7 @@ const sendClaimEmails = async (job: JobType, mysql: MySql) => {
149149
);
150150

151151
updates.push(
152-
`(${currentUser.id}, '${currentUser.email}', ${AirdropStatus.AIRDROP_ERROR}, null, '${currentUser.wallet}')`,
152+
`(${currentUser.id}, '${currentUser.email}', ${AirdropStatus.AIRDROP_ERROR}, NULL, '${currentUser.wallet}')`,
153153
);
154154
}
155155
}

backend/src/routes/send-claim-mail.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function resolve(req: Request, res: Response): Promise<void> {
2525
const mintedCount = await mysql.paramExecute(
2626
`SELECT COUNT(id) as total FROM user WHERE
2727
airdrop_status IN (
28-
${AirdropStatus.AIRDROP_COMPLETED},
28+
${AirdropStatus.AIRDROP_COMPLETED}
2929
)
3030
AND status = @status
3131
;

0 commit comments

Comments
 (0)