Updating app_message Table using api
can i am updating the app_message Table using the below api in javascript
https://your_cloud_name/jw/web/json/console/app/your_app_Name/app_version/message/submit
and it is working
is it safe to use.
My team is Saying that Updating the Database with this api is Not proper for the Application Security
because it can get expose to the outside users.
And if Joget shut Down the Internal Use of that API then it will create a big problem.
$(document).ready(function(){
function post_data(){
const url = "https://your_cloud_name/jw/web/json/console/app/your_app_name/app_version/message/submit";
// Replace the following data with your actual payload
const payload = {
locale: "ja_JP",
data: JSON.stringify([
{"id":`${$('[name=ouid]')}`,"key":`${$('#message_key').val()}`,"value":`${$('#new_value').val()}`}
]),
};
const headers = {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
// Add more headers as needed
};
fetch(url, {
method: "POST",
headers: headers,
body: new URLSearchParams(payload).toString(),
})
.then(response => {
console.log("Status Code:", response.status);
return response.text();
})
.then(data => {
console.log("Response Content:", data);
window.location.href = "https://your_cloud_name/jw/web/json/console/app/your_app_name/app_version/message/submit";
})
.catch(error => {
console.error("Error:", error);
});
}
$('.click').click(post_data);
})