refactor: share instrument search presentation
Frontend verify / commits (pull_request) Successful in 24s
Frontend verify / security (pull_request) Failing after 9s
Frontend verify / verify (pull_request) Skipped

This commit is contained in:
2026-09-29 05:14:28 +03:00
parent 0865b35f93
commit 32a77860c8
18 changed files with 489 additions and 551 deletions
+6 -13
View File
@@ -34,7 +34,6 @@ function useCardPageVm() {
const card = useBankCard(cardId);
const updateCard = useUpdateBankCard();
const [archiveError, setArchiveError] = useState<unknown>();
const cards = useBankCards(true);
const history = useBankOperations(cardId, {
@@ -94,7 +93,7 @@ function useCardPageVm() {
});
return {
archiveError,
archiveError: updateCard.isError ? updateCard.error : undefined,
archivePending: updateCard.isPending,
canAddOperation: !card.data?.archivedAt && Boolean(cards.data),
card: card.data,
@@ -149,19 +148,13 @@ function useCardPageVm() {
loading: summary.isLoading,
retry: () => void summary.refetch(),
},
toggleArchive: async () => {
toggleArchive: () => {
if (!card.data) return;
setArchiveError(undefined);
try {
await updateCard.mutateAsync({
body: { archived: !card.data.archivedAt, version: card.data.version },
id: card.data.id,
});
}
catch (error) {
setArchiveError(error);
}
updateCard.mutate({
body: { archived: !card.data.archivedAt, version: card.data.version },
id: card.data.id,
});
},
totalPages:
pageSize === "all"