mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 22:41:09 +02:00
🐛 fix(gifts): convert undefined sourceAppId to null for Drizzle
Drizzle ORM throws "UNDEFINED_VALUE" error when inserting undefined values. Convert dto.sourceAppId to null using nullish coalescing operator. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
ba818ef256
commit
72b162524c
1 changed files with 3 additions and 3 deletions
|
|
@ -359,7 +359,7 @@ export class GiftCodeService {
|
|||
redeemerUserId: userId,
|
||||
status: 'failed_wrong_user',
|
||||
creditsReceived: 0,
|
||||
sourceAppId: dto.sourceAppId,
|
||||
sourceAppId: dto.sourceAppId ?? null,
|
||||
});
|
||||
|
||||
return { success: false, error: 'This gift code is for a specific person' };
|
||||
|
|
@ -383,7 +383,7 @@ export class GiftCodeService {
|
|||
redeemerUserId: userId,
|
||||
status: 'failed_wrong_answer',
|
||||
creditsReceived: 0,
|
||||
sourceAppId: dto.sourceAppId,
|
||||
sourceAppId: dto.sourceAppId ?? null,
|
||||
});
|
||||
|
||||
return { success: false, error: 'Incorrect answer' };
|
||||
|
|
@ -489,7 +489,7 @@ export class GiftCodeService {
|
|||
creditsReceived: creditsToAdd,
|
||||
portionNumber,
|
||||
creditTransactionId: creditTx.id,
|
||||
sourceAppId: dto.sourceAppId,
|
||||
sourceAppId: dto.sourceAppId ?? null,
|
||||
});
|
||||
|
||||
this.logger.log('Gift code redeemed', {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue