improved note making
This commit is contained in:
@@ -140,7 +140,8 @@ export const HomePage = () => {
|
|||||||
<Table.Cell>{item.item_name}</Table.Cell>
|
<Table.Cell>{item.item_name}</Table.Cell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
))}
|
))}
|
||||||
</Table.Body>
|
<Table.Row>
|
||||||
|
<Table.Cell colSpan={2}>
|
||||||
<InputGroup
|
<InputGroup
|
||||||
endElement={
|
endElement={
|
||||||
<Span color="fg.muted" textStyle="xs">
|
<Span color="fg.muted" textStyle="xs">
|
||||||
@@ -153,21 +154,29 @@ export const HomePage = () => {
|
|||||||
value={note}
|
value={note}
|
||||||
maxLength={MAX_CHARACTERS}
|
maxLength={MAX_CHARACTERS}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setNote(e.currentTarget.value.slice(0, MAX_CHARACTERS));
|
setNote(
|
||||||
|
e.currentTarget.value.slice(0, MAX_CHARACTERS)
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
|
</Table.Cell>
|
||||||
|
</Table.Row>
|
||||||
|
</Table.Body>
|
||||||
</Table.Root>
|
</Table.Root>
|
||||||
</Table.ScrollArea>
|
</Table.ScrollArea>
|
||||||
)}
|
)}
|
||||||
{selectedItems.length >= 1 && (
|
{selectedItems.length >= 1 && (
|
||||||
<Button
|
<Button
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
createLoan(selectedItems, startDate, endDate, note).then((response) => {
|
createLoan(selectedItems, startDate, endDate, note).then(
|
||||||
|
(response) => {
|
||||||
if (response.status === "error") {
|
if (response.status === "error") {
|
||||||
setMsgStatus("error");
|
setMsgStatus("error");
|
||||||
setMsgTitle(response.title || t("error"));
|
setMsgTitle(response.title || t("error"));
|
||||||
setMsgDescription(response.description || t("unknown-error"));
|
setMsgDescription(
|
||||||
|
response.description || t("unknown-error")
|
||||||
|
);
|
||||||
setIsMsg(true);
|
setIsMsg(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -175,7 +184,8 @@ export const HomePage = () => {
|
|||||||
setMsgTitle(t("success"));
|
setMsgTitle(t("success"));
|
||||||
setMsgDescription(t("loan-success"));
|
setMsgDescription(t("loan-success"));
|
||||||
setIsMsg(true);
|
setIsMsg(true);
|
||||||
})
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{t("create-loan")}
|
{t("create-loan")}
|
||||||
|
|||||||
Reference in New Issue
Block a user