mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-05 22:36:56 +01:00
Call push rule /actions api before the /enabled api
This commit is contained in:
parent
c12621e89a
commit
bb4ec4f542
@ -34,10 +34,16 @@ internal interface UpdatePushRuleActionsTask : Task<UpdatePushRuleActionsTask.Pa
|
||||
|
||||
internal class DefaultUpdatePushRuleActionsTask @Inject constructor(
|
||||
private val pushRulesApi: PushRulesApi,
|
||||
private val globalErrorReceiver: GlobalErrorReceiver
|
||||
private val globalErrorReceiver: GlobalErrorReceiver,
|
||||
) : UpdatePushRuleActionsTask {
|
||||
|
||||
override suspend fun execute(params: UpdatePushRuleActionsTask.Params) {
|
||||
if (params.actions != null) {
|
||||
val body = mapOf("actions" to params.actions.toJson())
|
||||
executeRequest(globalErrorReceiver) {
|
||||
pushRulesApi.updateRuleActions(params.kind.value, params.ruleId, body)
|
||||
}
|
||||
}
|
||||
executeRequest(globalErrorReceiver) {
|
||||
pushRulesApi.updateEnableRuleStatus(
|
||||
params.kind.value,
|
||||
@ -45,11 +51,5 @@ internal class DefaultUpdatePushRuleActionsTask @Inject constructor(
|
||||
EnabledBody(params.enable)
|
||||
)
|
||||
}
|
||||
if (params.actions != null) {
|
||||
val body = mapOf("actions" to params.actions.toJson())
|
||||
executeRequest(globalErrorReceiver) {
|
||||
pushRulesApi.updateRuleActions(params.kind.value, params.ruleId, body)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user