Skip to content

Commit e6c8b94

Browse files
committed
feat: use decline instead of reject
1 parent f2166c9 commit e6c8b94

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

client/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const App = () => {
132132
Array<
133133
PendingElicitationRequest & {
134134
resolve: (response: ElicitationResponse) => void;
135-
reject: (error: Error) => void;
135+
decline: (error: Error) => void;
136136
}
137137
>
138138
>([]);
@@ -223,7 +223,7 @@ const App = () => {
223223
requestedSchema: request.params.requestedSchema,
224224
},
225225
resolve,
226-
reject: (error: Error) => {
226+
decline: (error: Error) => {
227227
console.error("Elicitation request rejected:", error);
228228
},
229229
},

client/src/components/ElicitationRequest.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ const ElicitationRequest = ({
100100
}
101101
};
102102

103-
const handleReject = () => {
104-
onResolve(request.id, { action: "reject" });
103+
const handleDecline = () => {
104+
onResolve(request.id, { action: "decline" });
105105
};
106106

107107
const handleCancel = () => {
@@ -158,7 +158,7 @@ const ElicitationRequest = ({
158158
<Button type="button" onClick={handleAccept}>
159159
Submit
160160
</Button>
161-
<Button type="button" variant="outline" onClick={handleReject}>
161+
<Button type="button" variant="outline" onClick={handleDecline}>
162162
Decline
163163
</Button>
164164
<Button type="button" variant="outline" onClick={handleCancel}>

client/src/components/ElicitationTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface ElicitationRequestData {
1010
}
1111

1212
export interface ElicitationResponse {
13-
action: "accept" | "reject" | "cancel";
13+
action: "accept" | "decline" | "cancel";
1414
content?: Record<string, unknown>;
1515
}
1616

client/src/components/__tests__/ElicitationRequest.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ describe("ElicitationRequest", () => {
138138
});
139139
});
140140

141-
it("should call onResolve with reject action when Decline button is clicked", async () => {
141+
it("should call onResolve with decline action when Decline button is clicked", async () => {
142142
renderElicitationRequest();
143143

144144
await act(async () => {
145145
fireEvent.click(screen.getByRole("button", { name: /decline/i }));
146146
});
147147

148-
expect(mockOnResolve).toHaveBeenCalledWith(1, { action: "reject" });
148+
expect(mockOnResolve).toHaveBeenCalledWith(1, { action: "decline" });
149149
});
150150

151151
it("should call onResolve with cancel action when Cancel button is clicked", async () => {

0 commit comments

Comments
 (0)