Skip to content

Commit d0445ef

Browse files
committed
fix: simplify gateway client return type, remove unused json parsing
1 parent 8f08403 commit d0445ef

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

internal-packages/compute/src/gatewayClient.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class ComputeGatewayClient {
1212
async createTemplate(
1313
req: TemplateCreateRequest,
1414
options?: { signal?: AbortSignal }
15-
): Promise<{ accepted: boolean; templateId?: string }> {
15+
): Promise<{ accepted: boolean }> {
1616
const url = `${this.opts.gatewayUrl}/api/templates`;
1717

1818
const headers: Record<string, string> = {
@@ -36,11 +36,6 @@ export class ComputeGatewayClient {
3636
throw new Error(`Gateway template creation failed (${response.status}): ${errorBody}`);
3737
}
3838

39-
if (response.status === 202) {
40-
return { accepted: true };
41-
}
42-
43-
const result = await response.json();
44-
return { accepted: false, templateId: result.template_id };
39+
return { accepted: response.status === 202 };
4540
}
4641
}

0 commit comments

Comments
 (0)