Skip to content

Commit 0d72833

Browse files
authored
Merge pull request #27 from objectstack-ai/copilot/fix-ci-deployment-issues
2 parents 9a04d84 + 4b295f1 commit 0d72833

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

__tests__/hooks/useNotifications.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ describe("useNotifications", () => {
178178
expect(result.current.isLoading).toBe(false);
179179
});
180180

181-
let prefs: Record<string, unknown> | null;
181+
let prefs: Awaited<ReturnType<typeof result.current.getPreferences>>;
182182
await act(async () => {
183183
prefs = await result.current.getPreferences();
184184
});

__tests__/hooks/useWorkflowState.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ describe("useWorkflowState", () => {
172172
expect(mockReject).toHaveBeenCalledWith({
173173
object: "tasks",
174174
recordId: "rec-1",
175-
comment: "Needs changes",
175+
reason: "Needs changes",
176176
});
177177
});
178178
});

hooks/useNotifications.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import { useClient } from "@objectstack/client-react";
33
import type {
44
ListNotificationsResponse,
55
RegisterDeviceResponse,
6+
} from "@objectstack/client";
7+
import type {
68
GetNotificationPreferencesResponse,
79
UpdateNotificationPreferencesResponse,
8-
} from "@objectstack/client";
10+
} from "@objectstack/spec/api";
911

1012
/* ------------------------------------------------------------------ */
1113
/* Types */

hooks/useWorkflowState.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export interface UseWorkflowStateResult {
4848
/** Approve a workflow step */
4949
approve: (comment?: string) => Promise<WorkflowApproveResponse>;
5050
/** Reject a workflow step */
51-
reject: (comment?: string) => Promise<WorkflowRejectResponse>;
51+
reject: (reason: string, comment?: string) => Promise<WorkflowRejectResponse>;
5252
/** Refetch the workflow state */
5353
refetch: () => Promise<void>;
5454
}
@@ -121,10 +121,11 @@ export function useWorkflowState(
121121
);
122122

123123
const doReject = useCallback(
124-
async (comment?: string): Promise<WorkflowRejectResponse> => {
124+
async (reason: string, comment?: string): Promise<WorkflowRejectResponse> => {
125125
const result = await client.workflow.reject({
126126
object: objectName,
127127
recordId,
128+
reason,
128129
comment,
129130
});
130131
await fetchState();

0 commit comments

Comments
 (0)