mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Spotify Node): Fix issue with null values breaking the response (#12080)
This commit is contained in:
@@ -5,7 +5,7 @@ import type {
|
||||
IHookFunctions,
|
||||
JsonObject,
|
||||
IHttpRequestMethods,
|
||||
IRequestOptions,
|
||||
IHttpRequestOptions,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
@@ -21,7 +21,7 @@ export async function spotifyApiRequest(
|
||||
query?: IDataObject,
|
||||
uri?: string,
|
||||
): Promise<any> {
|
||||
const options: IRequestOptions = {
|
||||
const options: IHttpRequestOptions = {
|
||||
method,
|
||||
headers: {
|
||||
'User-Agent': 'n8n',
|
||||
@@ -29,7 +29,7 @@ export async function spotifyApiRequest(
|
||||
Accept: ' application/json',
|
||||
},
|
||||
qs: query,
|
||||
uri: uri || `https://api.spotify.com/v1${endpoint}`,
|
||||
url: uri ?? `https://api.spotify.com/v1${endpoint}`,
|
||||
json: true,
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ export async function spotifyApiRequest(
|
||||
options.body = body;
|
||||
}
|
||||
try {
|
||||
return await this.helpers.requestOAuth2.call(this, 'spotifyOAuth2Api', options);
|
||||
return await this.helpers.httpRequestWithAuthentication.call(this, 'spotifyOAuth2Api', options);
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user