feat: integrate post AI translation with UI toggle and backend queue
This commit is contained in:
7
API.js
7
API.js
@@ -1,6 +1,6 @@
|
||||
import i18n from "./i18nMessages.js";
|
||||
//const baseUrl = "https://emiapi.reynafamily.com";
|
||||
const baseUrl = "http://localhost:3000";
|
||||
const baseUrl = "https://emiapi.reynafamily.com";
|
||||
//const baseUrl = "http://localhost:3000";
|
||||
const requestErrorCooldownMs = 30000;
|
||||
const profileFailureCooldownMs = 60000;
|
||||
const recentRequestErrors = {};
|
||||
@@ -270,6 +270,9 @@ const API = {
|
||||
updatePost(post){
|
||||
return postCall("/post/" + post._id, {content: post.content});
|
||||
},
|
||||
translatePost(postid, targetLang) {
|
||||
return postCall("/post/translate", { postid, targetLang });
|
||||
},
|
||||
newPost(content, toProfile, isNews) {
|
||||
//Content is expected to be a string.
|
||||
let params = { content };
|
||||
|
||||
Reference in New Issue
Block a user