🚨 JS-0116 JS-0376
This commit is contained in:
parent
77bfe48613
commit
71ff30ea87
4 changed files with 5 additions and 5 deletions
|
@ -5,7 +5,7 @@ import transactionRules from "./transactionRules";
|
|||
export default async (guild: Guild, user: User, amount: number) => {
|
||||
return await prisma.$transaction(async (tx) => {
|
||||
// 1. Check if the transaction is valid.
|
||||
await transactionRules(guild, user, amount);
|
||||
transactionRules(guild, user, amount);
|
||||
|
||||
// 2. Make the transaction.
|
||||
const recipient = await tx.guildMember.upsert({
|
||||
|
|
|
@ -5,7 +5,7 @@ import transactionRules from "./transactionRules";
|
|||
export default async (guild: Guild, user: User, amount: number) => {
|
||||
return await prisma.$transaction(async (tx) => {
|
||||
// 1. Check if the transaction is valid.
|
||||
await transactionRules(guild, user, amount);
|
||||
transactionRules(guild, user, amount);
|
||||
|
||||
// 2. Make the transaction.
|
||||
const recipient = await tx.guildMember.upsert({
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Guild, User } from "discord.js";
|
||||
|
||||
export default async (guild: Guild, user: User, amount: number) => {
|
||||
export default (guild: Guild, user: User, amount: number) => {
|
||||
// 1. Verify that the amount is not above 100.000.000 credits.
|
||||
if (amount > 100000000) {
|
||||
throw new Error("You can't give more than 1.000.000 credits.");
|
||||
|
|
|
@ -48,8 +48,8 @@ export default async (guild: Guild, from: User, to: User, amount: number) => {
|
|||
}
|
||||
|
||||
// 5. Check if the transactions is valid.
|
||||
await transactionRules(guild, from, amount);
|
||||
await transactionRules(guild, to, amount);
|
||||
transactionRules(guild, from, amount);
|
||||
transactionRules(guild, to, amount);
|
||||
|
||||
// 6. Verify that sender and recipient are not the same user.
|
||||
if (from.id === to.id) throw new Error("You can't transfer to yourself.");
|
||||
|
|
Loading…
Add table
Reference in a new issue