format: format with biome
This commit is contained in:
@@ -12,32 +12,33 @@ export function createMutators(authData: AuthData | null) {
|
||||
async get(tx: Tx, { link_token }: { link_token: string }) {},
|
||||
async updateTransactions() {},
|
||||
async updateBalences() {},
|
||||
async deleteAccounts(tx: Tx, { accountIds }: { accountIds: string[] }) {
|
||||
async deleteAccounts(tx: Tx, { accountIds }: { accountIds: string[] }) {
|
||||
isLoggedIn(authData);
|
||||
for (const id of accountIds) {
|
||||
const token = await tx.query.plaidAccessTokens.where("userId", '=', authData.user.id).one();
|
||||
const token = await tx.query.plaidAccessTokens
|
||||
.where("userId", "=", authData.user.id)
|
||||
.one();
|
||||
if (!token) continue;
|
||||
await tx.mutate.plaidAccessTokens.delete({ id });
|
||||
|
||||
const balances = await tx.query.balance
|
||||
.where('user_id', '=', authData.user.id)
|
||||
.where("tokenId", '=', token.id)
|
||||
.where("user_id", "=", authData.user.id)
|
||||
.where("tokenId", "=", token.id)
|
||||
.run();
|
||||
|
||||
for (const bal of balances) {
|
||||
await tx.mutate.balance.delete({ id: bal.id });
|
||||
const txs = await tx.query.transaction
|
||||
.where('user_id', '=', authData.user.id)
|
||||
.where('account_id', '=', bal.tokenId)
|
||||
.where("user_id", "=", authData.user.id)
|
||||
.where("account_id", "=", bal.tokenId)
|
||||
.run();
|
||||
for (const transaction of txs) {
|
||||
await tx.mutate.transaction.delete({ id: transaction.id });
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
} as const;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user