mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-11-08 12:24:45 +00:00
15 lines
559 B
TypeScript
15 lines
559 B
TypeScript
import { updateFindingTriage } from "@/actions/findings";
|
|
import { UsageLimitError } from "@/lib/action-errors";
|
|
import type { UpdateFindingTriageInput } from "@/types/findings-triage";
|
|
|
|
/** Client-side triage write: a usage-limit refusal throws, so callers skip their local patch. */
|
|
export const updateFindingTriageOrThrow = async (
|
|
input: UpdateFindingTriageInput,
|
|
) => {
|
|
const result = await updateFindingTriage(input);
|
|
if (result && typeof result === "object" && "usageLimited" in result) {
|
|
throw new UsageLimitError();
|
|
}
|
|
return result;
|
|
};
|