Fix some checkout management stuff

This commit is contained in:
2024-06-25 16:56:07 +02:00
parent 38ca48b6b5
commit b7d26e84cb
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -29,7 +29,12 @@ export default function EditContainerRoute() {
<ListGroup>
{loaderData.checkouts.map((checkout) => (
<ListGroup.Item key={checkout.id}>
<b>{checkout.id}</b> {checkout.container.drink.name} - {containerTypeToString(checkout.container.type)} - {volume(checkout.container.volume)} - {timeAgo(new Date(checkout.checkoutAt))} - {checkout.inventoryAfter} left
<b className="me-1">{checkout.id}</b>
{checkout.container.drink.name}
<Badge bg="secondary" className="ms-1">{containerTypeToString(checkout.container.type)}</Badge>
<Badge bg="secondary" className="ms-1">{volume(checkout.container.volume)}</Badge>
<Badge bg="secondary" className="ms-1">{timeAgo(new Date(checkout.checkoutAt))} - {checkout.checkoutAt.slice(0,-5)}</Badge>
<Badge bg="secondary" className="ms-1">{checkout.inventoryAfter} left</Badge>
<div className="float-end">
<LinkContainer to={"" + checkout.id}>
<Button variant="primary" className="mx-3">
+1 -1
View File
@@ -18,7 +18,7 @@ export const action = async ({
const containerId = Number(form.get("container"));
const inventoryAfter = Number(form.get("inventoryAfter"));
const checkoutAt = new Date(form.get("checkoutAt")!.toString());
const checkoutAt = String(form.get("checkoutAt")) + ":00.000z" || Date.now().toString();
try{
const checkout = await dbe.history.create({ data: {