Compare commits
2 Commits
169de55b0a
...
cdd32c56db
| Author | SHA1 | Date | |
|---|---|---|---|
| cdd32c56db | |||
| 743ced358d |
@ -2,12 +2,7 @@ import { showErrorToast } from "@repo/rdx-ui/helpers";
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import type { ProformaSummaryData } from "../../types";
|
import type { ProformaSummaryData } from "../../types";
|
||||||
import { useChangeProformaStatus } from "../hooks/use-change-proforma-status";
|
import { useChangeProformaStatus } from "../hooks/use-change-status";
|
||||||
|
|
||||||
type ProformasType = {
|
|
||||||
id: string;
|
|
||||||
status: string;
|
|
||||||
}[];
|
|
||||||
|
|
||||||
interface ChangeStatusDialogState {
|
interface ChangeStatusDialogState {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
@ -49,7 +44,7 @@ export function useChangeStatusDialogController() {
|
|||||||
setState((s) => ({ ...s, loading: true }));
|
setState((s) => ({ ...s, loading: true }));
|
||||||
|
|
||||||
for (const proforma of state.proformas) {
|
for (const proforma of state.proformas) {
|
||||||
await changeStatus(proforma.id.toString(), state.targetStatus, {
|
await changeStatus(proforma.id, state.targetStatus, {
|
||||||
onError: (err: unknown) => {
|
onError: (err: unknown) => {
|
||||||
const error = err as Error;
|
const error = err as Error;
|
||||||
showErrorToast("Error cambiando estado", error.message);
|
showErrorToast("Error cambiando estado", error.message);
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
export * from "./use-change-proforma-status";
|
export * from "./use-change-status";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user