fix: widen handleSubmitApproval to accept form parameters
This commit is contained in:
@@ -130,12 +130,15 @@ export const PresentationRoute = () => {
|
|||||||
|
|
||||||
const [approvalState, setApprovalState] = useState<DemoApprovalUiState>("ready");
|
const [approvalState, setApprovalState] = useState<DemoApprovalUiState>("ready");
|
||||||
|
|
||||||
const handleSubmitApproval = useCallback(async () => {
|
const handleSubmitApproval = useCallback(async (
|
||||||
const selectedIssueIds = selectedIssueIdsForDemo(demo.interruptPayload);
|
selectedIssueIds?: ReadonlyArray<string>,
|
||||||
if (demo.state.phase !== "review" || selectedIssueIds.length === 0) return;
|
comment?: string,
|
||||||
|
) => {
|
||||||
|
const ids = selectedIssueIds ?? selectedIssueIdsForDemo(demo.interruptPayload);
|
||||||
|
if (demo.state.phase !== "review" || ids.length === 0) return;
|
||||||
|
|
||||||
setApprovalState("submitted");
|
setApprovalState("submitted");
|
||||||
await demo.submitSelectedIssues(selectedIssueIds, "Create the selected issue.");
|
await demo.submitSelectedIssues(ids, comment ?? "Create the selected issue.");
|
||||||
await demo.next();
|
await demo.next();
|
||||||
dispatch({
|
dispatch({
|
||||||
type: "jump",
|
type: "jump",
|
||||||
|
|||||||
Reference in New Issue
Block a user