File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -226,13 +226,12 @@ async function handleApiRequest(req, res) {
226226 // Messaging API
227227 'send-message' : async ( ) => {
228228 const { content } = req . body ;
229- const message = content ;
230- if ( ! message ) return res . status ( 400 ) . send ( 'Missing content' ) ;
229+ if ( ! content ) return res . status ( 400 ) . send ( 'Missing content' ) ;
231230
232231 const id = Object . keys ( db . messages ) . length + 1 ;
233232 const messageData = {
234233 id,
235- message ,
234+ content ,
236235 user,
237236 timestamp : new Date ( ) . toISOString ( ) ,
238237 edited : false
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ async function fetchCurrentUser() {
2626 service : 'get-user'
2727 } )
2828 } ) ;
29- if ( response . ok ) currentUser = await response . text ( ) ;
29+ if ( response . ok ) currentUser = await response . json ( ) ; currentUser = currentUser [ 'user' ]
3030 } catch ( error ) {
3131 console . error ( 'Error fetching user:' , error ) ;
3232 }
You can’t perform that action at this time.
0 commit comments