App Screen 3 (UI + Backend integration)

Blog post 6.1 | Hasura Internship

Screen Three

The user can update events from this screen.

token = getCookie(“cookie_name”);
userId = getCookie(“cookie_user”);
url: dataUrl,
method: ‘post’,
headers: {
‘Authorization’: ‘Bearer ‘ + token,
‘Content-Type’: ‘application/json’
data: JSON.stringify({
“type”: “insert”,
“args”: {
“table”: “publish”,
“objects”: [{“description”: $(‘#description’).val(),
“file_id”: $(‘#my_file’).val(),
“user_id”: userId}]
window.location = ‘/my_events’;
console.log(‘failed to update’);

The app redirects to my events when the post is updated successfully.

Like what you read? Give Bibin Jaimon a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.