Update AdminServiceServer to use AuthenticatedAdminServiceBase
This commit is contained in:
1 parent
c4393637e7
commit
1b2aeee069
7 files changed
+57
-36
No files matched your search
@@ -7,9 +7,9 @@ open bts.api.orderman
|
||||
|
||||
let superuser = "bts"
|
||||
|
||||
let getAdminData (admin:IAdminService) (token) (fsuc) (ffail) =
|
||||
let getAdminData (admin:IAdminService) (fsuc) (ffail) =
|
||||
Cmd.ofPromise
|
||||
admin.get_filtered_admin_data { token = token }
|
||||
admin.get_filtered_admin_data ()
|
||||
fsuc
|
||||
(fun e -> ffail e.Message)
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ let init (context:ServiceContext.ServiceContext) =
|
||||
can_create = context.can_create
|
||||
this_username = context.username
|
||||
ShowLoading = false
|
||||
}, Access.getAdminData admin context.token UpdateAdminData NoAdminData
|
||||
}, Access.getAdminData admin UpdateAdminData NoAdminData
|
||||
|
||||
let existingSelection (scratch:BTSAccount) (previousScratch:BTSAccount) (data:AdminData) =
|
||||
List.choose id [
|
||||
@@ -76,7 +76,7 @@ let applySIMUpdate (data:SIMAccountData) = function
|
||||
let saveAccount (admin:IAdminService) (account:BTSAccount) (model:Model) = promise {
|
||||
let! result = admin.update_account { completeData = account }
|
||||
if result.isSuccess then
|
||||
let! data = admin.get_filtered_admin_data {token = model.token}
|
||||
let! data = admin.get_filtered_admin_data ()
|
||||
return UpdateAdminData data
|
||||
else
|
||||
return ErrorOccured (sprintf "Error saving account: %s" result.errorText)
|
||||
@@ -94,7 +94,7 @@ let createAccount (admin:IAdminService) (account:BTSAccount) (model:Model) = pro
|
||||
let deleteAccount (admin:IAdminService) (account:BTSAccount) (model:Model) = promise {
|
||||
let! result = admin.delete_account { id = account.id }
|
||||
if result.isSuccess then
|
||||
let! data = admin.get_filtered_admin_data {token = model.token}
|
||||
let! data = admin.get_filtered_admin_data ()
|
||||
return UpdateAdminData data
|
||||
else
|
||||
return ErrorOccured (sprintf "Error deleting account: %s" result.errorText)
|
||||
@@ -105,7 +105,7 @@ let cancelOrders (admin:IAdminService) (accountName:string) (orders:OrdersSummar
|
||||
let accounts = [| accountName |]
|
||||
let! result = admin.cancel_orders {accounts = accounts; users = users }
|
||||
|
||||
let! data = admin.get_filtered_admin_data {token = model.token}
|
||||
let! data = admin.get_filtered_admin_data ()
|
||||
return UpdateAdminData data
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ let isNewUser (user:BTSUser) =
|
||||
|
||||
let getAdminData (admin:IAdminService) (token:string) =
|
||||
Cmd.ofPromise
|
||||
admin.get_filtered_admin_data { token = token }
|
||||
admin.get_filtered_admin_data ()
|
||||
UpdateAdminData
|
||||
(fun _ -> RpcResponse "Error getting admin data")
|
||||
|
||||
@@ -156,7 +156,7 @@ let userIsSelected (initialState:BTSUser) (scratch:BTSUser) = scratch <> initial
|
||||
let saveUser (admin:IAdminService) (user:BTSUser) (model:Model) = promise {
|
||||
let! result = admin.update_user { completeData = user }
|
||||
if (result.isSuccess) then
|
||||
let! data = admin.get_filtered_admin_data {token = model.token}
|
||||
let! data = admin.get_filtered_admin_data ()
|
||||
return UpdateAdminData data
|
||||
else
|
||||
return ErrorOccured (sprintf "Error saving user: %s" result.errorText)
|
||||
@@ -165,7 +165,7 @@ let saveUser (admin:IAdminService) (user:BTSUser) (model:Model) = promise {
|
||||
let deleteUser (admin:IAdminService) (user:BTSUser) (model:Model) = promise {
|
||||
let! result = admin.delete_user { id = user.id }
|
||||
if (result.isSuccess) then
|
||||
let! data = admin.get_filtered_admin_data {token = model.token}
|
||||
let! data = admin.get_filtered_admin_data ()
|
||||
return UpdateAdminData data
|
||||
else
|
||||
return ErrorOccured (sprintf "Error deleting user: %s" result.errorText)
|
||||
|
||||
Reference in new issue
Block a user