@@ -358,6 +358,7 @@ export function sendByPayloadRoute<
358358 RequestHeaderSchema extends z . Schema | undefined = undefined ,
359359 IsNonJSONResponseExpected extends boolean = false ,
360360 IsEmptyResponseExpected extends boolean = false ,
361+ DoThrowOnError extends boolean = DEFAULT_THROW_ON_ERROR ,
361362> (
362363 client : Client ,
363364 routeDefinition : PayloadRouteDefinition <
@@ -377,10 +378,16 @@ export function sendByPayloadRoute<
377378 InferSchemaInput < RequestHeaderSchema >
378379 > ,
379380 options : Omit <
380- RequestOptions < InferSchemaOutput < ResponseBodySchema > , IsEmptyResponseExpected , boolean > ,
381+ RequestOptions < InferSchemaOutput < ResponseBodySchema > , IsEmptyResponseExpected , DoThrowOnError > ,
381382 'body' | 'headers' | 'query' | 'isEmptyResponseExpected' | 'responseSchema'
382383 > ,
383- ) {
384+ ) : Promise <
385+ RequestResultDefinitiveEither <
386+ InferSchemaOutput < ResponseBodySchema > ,
387+ IsEmptyResponseExpected ,
388+ DoThrowOnError
389+ >
390+ > {
384391 return sendResourceChange (
385392 client ,
386393 // @ts -expect-error TS loses exact string type during uppercasing
@@ -399,28 +406,6 @@ export function sendByPayloadRoute<
399406 ...options ,
400407 } ,
401408 )
402-
403- /**
404- * {
405- * // @ts -expect-error magic type inferring happening
406- * body: params.body,
407- * isEmptyResponseExpected: routeDefinition.isEmptyResponseExpected,
408- * isNonJSONResponseExpected: routeDefinition.isNonJSONResponseExpected,
409- * // biome-ignore lint/suspicious/noExplicitAny: FixMe try to find a solution
410- * requestBodySchema: routeDefinition.requestBodySchema as any,
411- * // biome-ignore lint/suspicious/noExplicitAny: FixMe try to find a solution
412- * responseBodySchema: routeDefinition.successResponseBodySchema as any,
413- * // @ts -expect-error magic type inferring happening
414- * queryParams: params.queryParams,
415- * queryParamsSchema: routeDefinition.requestQuerySchema,
416- * // @ts -expect-error magic type inferring happening
417- * path: routeDefinition.pathResolver(params.pathParams),
418- * // @ts -expect-error FixMe
419- * headers: params.headers,
420- * // @ts -expect-error magic type inferring happening
421- * headersSchema: params.headersSchema,
422- * }
423- */
424409}
425410
426411export const httpClient = {
0 commit comments