Skip to content

Commit a85154b

Browse files
committed
do not show price in cents
1 parent 1dfa6ba commit a85154b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/routes/(app)/expenses/[id]/+page.server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
} from "../signers";
1717
import { updateExpenseSchema, updateItemSchema } from "../types";
1818
import { setFlash } from "sveltekit-flash-message/server";
19+
import { convertPriceToCents } from "$lib/utils/convertPrice";
1920

2021
export const load = async ({ locals, params }) => {
2122
const { prisma } = locals;
@@ -76,6 +77,7 @@ export const actions = {
7677
where: { id: data.id },
7778
data: {
7879
...data,
80+
amount: convertPriceToCents(data.amount),
7981
committeeShortName: costCenter.committee,
8082
signerMemberId: signer,
8183
},

src/routes/(app)/expenses/[id]/ExpenseReceipt.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
data: {
2929
id: item.id,
3030
costCenter: item.costCenter,
31-
amount: item.amount,
31+
amount: item.amount / 100,
3232
comment: item.comment,
3333
},
3434
},

0 commit comments

Comments
 (0)