[+] Implement user settings

This commit is contained in:
Azalea
2024-03-05 22:18:38 -05:00
parent 49da7aafd0
commit fa4ccf07b8
5 changed files with 125 additions and 15 deletions

View File

@@ -121,6 +121,8 @@ export const USER = {
},
keychip: (): Promise<string> =>
post('/api/v2/user/keychip', {}).then(it => it.keychip),
setting: (key: string, value: string) =>
post('/api/v2/user/setting', { key: key === 'password' ? 'pwHash' : key, value }),
isLoggedIn,
ensureLoggedIn,
}
@@ -147,4 +149,4 @@ export const GAME = {
export const DATA = {
allMusic: (game: GameName): Promise<AllMusic> =>
fetch(`${DATA_HOST}/d/${game}/00/all-music.json`).then(it => it.json())
}
}