Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions frontend/src/stores/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ export async function updateSettingsAPI(settings: UserSettings) {

const res = await fetch(`${API_BASE_URL}/api/settings/${oldUsername}`, {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
headers: {
'Authorization': `Bearer ${localStorage.getItem('token') as string}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(settings)
})

Expand All @@ -78,7 +81,11 @@ export async function resetSettingsAPI() {

const user_name = parseJwt(token).username;
const res = await fetch(`${API_BASE_URL}/api/settings/reset/${user_name}`, {
method: 'DELETE'
method: 'DELETE',
headers: {
'Authorization': `Bearer ${localStorage.getItem('token') as string}`,
'Content-Type': 'application/json'
},
})

if (res.ok) {
Expand Down
Loading