Skip to content

Commit

Permalink
create and save loan
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrastopoulos committed Jul 7, 2023
1 parent 60fb520 commit 7a5c2b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/bot/src/commands/loan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const Loan = {
userId: borrower.id,
guildId: interaction.guildId
});
const loan = await datasource.getRepository(LoanEntity).save({
const loan = datasource.getRepository(LoanEntity).create({
guild: { id: interaction.guildId },
lender: { userId: interaction.user.id, guildId: interaction.guildId },
borrower: { userId: borrower.id, guildId: interaction.guildId },
Expand All @@ -186,6 +186,7 @@ export const Loan = {
duration: ms(duration),
status: LoanStatus.CANCELED
});
await datasource.getRepository(LoanEntity).save(loan);

await recordTransaction(
interaction.guildId,
Expand Down

0 comments on commit 7a5c2b4

Please sign in to comment.