Files
discord-decomp/modules/safety_flows/SafetyFlowsActionCreators.tsx
T
2026-11-01 12:12:55 +02:00

68 lines
1.6 KiB
TypeScript

// Metro module 16705 (f16706).
import { Endpoints } from "../../Constants";
import TrackedHTTPUtils from "../../utils/TrackedHTTPUtils";
import { NetworkActionNames } from "../../_bundle/Module503";
import APIError from "../../errors/APIError";
export async function getCurrentTask() {
let c31102_0 = await TrackedHTTPUtils.get({
url: Endpoints.SAFETY_FLOWS_TASK,
trackedActionData: {
event: NetworkActionNames.USER_VERIFY
},
rejectWithError: true
});
return c31102_0.status !== 204 ? c31102_0.body : null;
}
export async function completeTask(body) {
return (await TrackedHTTPUtils.post({
url: Endpoints.SAFETY_FLOWS_TASK,
body,
trackedActionData: {
event: NetworkActionNames.USER_VERIFY
},
rejectWithError: true
})).body;
}
export async function resendVerificationCode(flow_id) {
let r47;
let c28500_3;
let c28500_4 = 0;
let c31103_0;
try {
c28500_4 = 1;
r47 = await TrackedHTTPUtils.post({
url: Endpoints.SAFETY_FLOWS_RESEND_VERIFICATION_CODE,
body: {
flow_id
},
trackedActionData: {
event: NetworkActionNames.USER_VERIFY
},
rejectWithError: true
});
c28500_4 = 0;
} catch ($e) {
const r26 = $e;
let r8 = r26;
c28500_3 = r26;
if (c28500_4 !== 0) {
while (true) {
try {
const r65 = c28500_3;
c28500_4 = 0;
c31103_0 = r65;
throw new APIError(c31103_0);
} catch (r61) {
r8 = r61;
c28500_3 = r61;
if (c28500_4 === 0) {
break;
}
}
}
}
throw r8;
}
return r47;
}