Skip to content

Commit

Permalink
Fixed URI syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
ay0503 committed Nov 15, 2024
1 parent 42bca86 commit 3ef25db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion node_modules/placeholder.txt

This file was deleted.

6 changes: 3 additions & 3 deletions src/translate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ var request = require('request');
const translatorApi = module.exports;

translatorApi.translate = async function (postData) {
const TRANSLATOR_API = "https://translator-service-team-tbd-abh6bqaghsf4b8fz.eastus-01.azurewebsites.net"
const query = `?content=${postData.content}`;
const url = encodeURI(TRANSLATOR_API + '/' + query);
const TRANSLATOR_API = "https://translator-service-team-tbd-abh6bqaghsf4b8fz.eastus-01.azurewebsites.net";
const query = `/?content=${postData.content}`;
const url = encodeURI(TRANSLATOR_API + query);
const response = await fetch(url);
const data = await response.json();
return [data["is_english"], data["translated_content"]]
Expand Down

0 comments on commit 3ef25db

Please sign in to comment.