Skip to content

Commit

Permalink
use device time
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbuechele committed Jul 29, 2024
1 parent 7cd59f6 commit cce1d25
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/routes/kultCash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,16 @@ app.post('/log', async (c) => {
);
}

const orderCreate =
const orderCreate: Prisma.OrderCreateInput | undefined =
order != null
? {
payment: mapPayment(order.paymentMethod),
createdAt: deviceTime,
device: {
connect: {
id: deviceId,
},
},
items: {
createMany: {
data: order.cartItems
Expand Down Expand Up @@ -258,10 +264,7 @@ app.post('/log', async (c) => {
if (!cardTransaction && orderCreate) {
// manually create order, because it's not part of a card transaction
await prismaClient.order.create({
data: {
...orderCreate,
deviceId,
},
data: orderCreate,
});
}

Expand Down

0 comments on commit cce1d25

Please sign in to comment.