Skip to content

Commit

Permalink
post to get
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 679672925
  • Loading branch information
Google AI Edge authored and copybara-github committed Sep 27, 2024
1 parent 256de27 commit ed66ea4
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/ui/src/services/extension_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {ExtensionCommand} from '../common/extension_command';
import {Extension} from '../common/types';

const EXTERNAL_GET_EXTENSIONS_API_PATH = '/api/v1/get_extensions';
const EXTERNAL_SEND_CMD_API_PATH = '/apipost/v1/send_command';
const EXTERNAL_SEND_CMD_API_PATH = '/api/v1/send_command';

/**
* Service for managing model explorer extensions.
Expand All @@ -40,15 +40,9 @@ export class ExtensionService {
async sendCommandToExtension<T>(
cmd: ExtensionCommand,
): Promise<{cmdResp?: T; otherError?: string}> {
const requestData: RequestInit = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
};
requestData.body = JSON.stringify(cmd);
try {
const resp = await fetch(EXTERNAL_SEND_CMD_API_PATH, requestData);
const url = `${EXTERNAL_SEND_CMD_API_PATH}?json=${JSON.stringify(cmd)}`;
const resp = await fetch(url);
if (!resp.ok) {
return {otherError: `Failed to convert model. ${resp.status}`};
}
Expand Down

0 comments on commit ed66ea4

Please sign in to comment.