mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
refactor: Add IRequestOptions type to helpers.request for more type safety (no-changelog) (#8563)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -7,6 +7,8 @@ import type {
|
||||
IDataObject,
|
||||
ILoadOptionsFunctions,
|
||||
INodePropertyOptions,
|
||||
IHttpRequestMethods,
|
||||
IRequestOptions,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
/**
|
||||
@@ -15,10 +17,10 @@ import type {
|
||||
*/
|
||||
export async function stripeApiRequest(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
method: IHttpRequestMethods,
|
||||
endpoint: string,
|
||||
body: object,
|
||||
query?: object,
|
||||
body: IDataObject,
|
||||
query?: IDataObject,
|
||||
) {
|
||||
const options = {
|
||||
method,
|
||||
@@ -26,7 +28,7 @@ export async function stripeApiRequest(
|
||||
qs: query,
|
||||
uri: `https://api.stripe.com/v1${endpoint}`,
|
||||
json: true,
|
||||
};
|
||||
} satisfies IRequestOptions;
|
||||
|
||||
if (options.qs && Object.keys(options.qs).length === 0) {
|
||||
delete options.qs;
|
||||
|
||||
Reference in New Issue
Block a user