File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,7 +51,10 @@ export async function updateSettingsAPI(settings: UserSettings) {
5151
5252 const res = await fetch ( `${ API_BASE_URL } /api/settings/${ oldUsername } ` , {
5353 method : 'PATCH' ,
54- headers : { 'Content-Type' : 'application/json' } ,
54+ headers : {
55+ 'Authorization' : `Bearer ${ localStorage . getItem ( 'token' ) as string } ` ,
56+ 'Content-Type' : 'application/json'
57+ } ,
5558 body : JSON . stringify ( settings )
5659 } )
5760
@@ -78,7 +81,11 @@ export async function resetSettingsAPI() {
7881
7982 const user_name = parseJwt ( token ) . username ;
8083 const res = await fetch ( `${ API_BASE_URL } /api/settings/reset/${ user_name } ` , {
81- method : 'DELETE'
84+ method : 'DELETE' ,
85+ headers : {
86+ 'Authorization' : `Bearer ${ localStorage . getItem ( 'token' ) as string } ` ,
87+ 'Content-Type' : 'application/json'
88+ } ,
8289 } )
8390
8491 if ( res . ok ) {
You can’t perform that action at this time.
0 commit comments