replaced mock with actual post call
This commit is contained in:
@@ -60,7 +60,7 @@ const upsertData = async (
|
||||
// Insert new entries in chunks
|
||||
console.time("insertion time");
|
||||
const chunks = chunkArray(entries, chunkSize);
|
||||
// .map(async (chunk) => {
|
||||
// .map(async (chunk) => {
|
||||
// await surreal.insert<BookingEntry>(tableName, chunk);
|
||||
// });
|
||||
// for (let i = 0; i < chunks.length; i += 2) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
import Fetch from "node-fetch";
|
||||
import { HttpsProxyAgent } from "https-proxy-agent";
|
||||
|
||||
export type APIRespnose<T> = {
|
||||
export type APIResponse<T> = {
|
||||
code: number;
|
||||
success: boolean;
|
||||
message: string;
|
||||
@@ -57,7 +57,7 @@ export async function postDataToApi(payload: {
|
||||
data: PostDataEntry[];
|
||||
users: ApiPostUserWithParent[];
|
||||
}) {
|
||||
const responses = [] as APIRespnose<[]>[];
|
||||
const responses = [] as APIResponse<[]>[];
|
||||
const responsesIds = [] as { requestId: number; bookId: string }[];
|
||||
let failedResponses = 0;
|
||||
let successResponses = 0;
|
||||
@@ -116,7 +116,7 @@ export async function postDataToApi(payload: {
|
||||
drawId,
|
||||
date,
|
||||
);
|
||||
const res = await mockSendBatchRequest(
|
||||
const res = await sendBatchRequest(
|
||||
session,
|
||||
dealerId,
|
||||
payload.draw,
|
||||
@@ -124,7 +124,7 @@ export async function postDataToApi(payload: {
|
||||
message,
|
||||
);
|
||||
let rj:
|
||||
| APIRespnose<{
|
||||
| APIResponse<{
|
||||
bookDtos: {
|
||||
bookId: string;
|
||||
requestId: number;
|
||||
|
||||
Reference in New Issue
Block a user