Update sharing settings
This commit is contained in:
@@ -11,6 +11,7 @@ export type GenericResponse = {
|
||||
}
|
||||
|
||||
export type User = {
|
||||
id: string,
|
||||
username: string,
|
||||
email: string,
|
||||
otp_enabled: boolean,
|
||||
@@ -20,12 +21,10 @@ export type User = {
|
||||
filesystem_node_count: number,
|
||||
is_admin: boolean,
|
||||
balance_micro_eur: number,
|
||||
hotlinking_enabled: boolean,
|
||||
monthly_transfer_cap: number,
|
||||
monthly_transfer_used: number,
|
||||
file_viewer_branding: Map<string, string>,
|
||||
file_embed_domains: string,
|
||||
skip_file_viewer: boolean,
|
||||
embed_domains: string,
|
||||
affiliate_user_name: string,
|
||||
checkout_country: string,
|
||||
checkout_name: string,
|
||||
@@ -158,10 +157,12 @@ export const put_user = async (data: Object) => {
|
||||
))
|
||||
|
||||
// Update the user store
|
||||
for (let key of Object.keys(data)) {
|
||||
cached_user[key] = data[key]
|
||||
}
|
||||
user.set(cached_user)
|
||||
user.update((user: User) => {
|
||||
for (let key of Object.keys(data)) {
|
||||
user[key] = data[key]
|
||||
}
|
||||
return user
|
||||
})
|
||||
}
|
||||
|
||||
export const logout_user = async (redirect_path: string) => {
|
||||
|
||||
Reference in New Issue
Block a user