File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,12 +43,9 @@ async function getAllMessages() {
4343 likeButton . textContent = "Like" ;
4444
4545 likeButton . addEventListener ( "click" , async ( ) => {
46- await fetch (
47- `${ API_BASE_URL } /messages/${ message . id } /like` ,
48- {
49- method : "POST" ,
50- } ,
51- ) ;
46+ await fetch ( `${ API_BASE_URL } /messages/${ message . id } /like` , {
47+ method : "POST" ,
48+ } ) ;
5249 } ) ;
5350
5451 // put it all together
@@ -89,19 +86,16 @@ formElement.addEventListener("submit", async (event) => {
8986
9087 try {
9188 // Send the data
92- const response = await fetch (
93- `${ API_BASE_URL } /messages` ,
94- {
95- method : "POST" ,
96- headers : {
97- "Content-Type" : "application/json" ,
98- } ,
99- body : JSON . stringify ( {
100- sender : senderValue ,
101- text : messageValue ,
102- } ) ,
89+ const response = await fetch ( `${ API_BASE_URL } /messages` , {
90+ method : "POST" ,
91+ headers : {
92+ "Content-Type" : "application/json" ,
10393 } ,
104- ) ;
94+ body : JSON . stringify ( {
95+ sender : senderValue ,
96+ text : messageValue ,
97+ } ) ,
98+ } ) ;
10599
106100 if ( response . ok ) {
107101 // clear the sender and message input values
You can’t perform that action at this time.
0 commit comments