refactor: standardize quotation marks across all files and improve code consistency
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { prisma } from "@/lib/prisma"
|
||||
import type { Account } from "@/lib/types"
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import type { Account } from "@/lib/types";
|
||||
|
||||
export const accountService = {
|
||||
async create(data: Omit<Account, "id">): Promise<Account> {
|
||||
@@ -14,7 +14,7 @@ export const accountService = {
|
||||
currency: data.currency,
|
||||
lastImport: data.lastImport,
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
return {
|
||||
id: created.id,
|
||||
@@ -26,10 +26,13 @@ export const accountService = {
|
||||
balance: created.balance,
|
||||
currency: created.currency,
|
||||
lastImport: created.lastImport,
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
async update(id: string, data: Partial<Omit<Account, "id">>): Promise<Account> {
|
||||
async update(
|
||||
id: string,
|
||||
data: Partial<Omit<Account, "id">>,
|
||||
): Promise<Account> {
|
||||
const updated = await prisma.account.update({
|
||||
where: { id },
|
||||
data: {
|
||||
@@ -42,7 +45,7 @@ export const accountService = {
|
||||
currency: data.currency,
|
||||
lastImport: data.lastImport,
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
return {
|
||||
id: updated.id,
|
||||
@@ -54,14 +57,13 @@ export const accountService = {
|
||||
balance: updated.balance,
|
||||
currency: updated.currency,
|
||||
lastImport: updated.lastImport,
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
async delete(id: string): Promise<void> {
|
||||
// Transactions will be deleted automatically due to onDelete: Cascade
|
||||
await prisma.account.delete({
|
||||
where: { id },
|
||||
})
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user