mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
🐛 Bug Fixes
This commit is contained in:
@@ -46,11 +46,9 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
|
||||
const { access_token } = await getAccessToken.call(this, credentials as IDataObject);
|
||||
|
||||
options.headers!.Authorization = `Bearer ${access_token}`;
|
||||
console.log(options);
|
||||
//@ts-ignore
|
||||
return await this.helpers.request(options);
|
||||
} else {
|
||||
console.log(this.getCredentials('googleBooksOAuth2Api'));
|
||||
//@ts-ignore
|
||||
return await this.helpers.requestOAuth2.call(this, 'googleBooksOAuth2Api', options);
|
||||
}
|
||||
|
||||
@@ -279,6 +279,24 @@ export class GoogleBooks implements INodeType {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Bookshelf ID',
|
||||
name: 'shelfId',
|
||||
type: 'string',
|
||||
description: 'ID of the bookshelf',
|
||||
default: '',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'getAll',
|
||||
],
|
||||
resource: [
|
||||
'bookshelfVolume',
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Volume ID',
|
||||
name: 'volumeId',
|
||||
@@ -296,6 +314,7 @@ export class GoogleBooks implements INodeType {
|
||||
],
|
||||
resource: [
|
||||
'bookshelfVolume',
|
||||
'volume',
|
||||
],
|
||||
},
|
||||
},
|
||||
@@ -423,12 +442,12 @@ export class GoogleBooks implements INodeType {
|
||||
const body: IDataObject = {
|
||||
volumeId,
|
||||
};
|
||||
responseData = await googleApiRequest.call(this, 'POST', `mylibrary/bookshelves/${shelfId}/addVolume`, body);
|
||||
responseData = await googleApiRequest.call(this, 'POST', `v1/mylibrary/bookshelves/${shelfId}/addVolume`, body);
|
||||
}
|
||||
|
||||
if (operation === 'clear') {
|
||||
const shelfId = this.getNodeParameter('shelfId', i) as string;
|
||||
responseData = await googleApiRequest.call(this, 'POST', `mylibrary/bookshelves/${shelfId}/clearVolumes`);
|
||||
responseData = await googleApiRequest.call(this, 'POST', `v1/mylibrary/bookshelves/${shelfId}/clearVolumes`);
|
||||
}
|
||||
|
||||
if (operation === 'getAll') {
|
||||
@@ -459,16 +478,16 @@ export class GoogleBooks implements INodeType {
|
||||
volumeId,
|
||||
volumePosition,
|
||||
};
|
||||
responseData = await googleApiRequest.call(this, 'POST', `mylibrary/bookshelves/${shelfId}/moveVolume`, body);
|
||||
responseData = await googleApiRequest.call(this, 'POST', `v1/mylibrary/bookshelves/${shelfId}/moveVolume`, body);
|
||||
}
|
||||
|
||||
if (operation === 'move') {
|
||||
if (operation === 'remove') {
|
||||
const shelfId = this.getNodeParameter('shelfId', i) as string;
|
||||
const volumeId = this.getNodeParameter('volumeId', i) as string;
|
||||
const body: IDataObject = {
|
||||
volumeId,
|
||||
};
|
||||
responseData = await googleApiRequest.call(this, 'POST', `mylibrary/bookshelves/${shelfId}/removeVolume`, body);
|
||||
responseData = await googleApiRequest.call(this, 'POST', `v1/mylibrary/bookshelves/${shelfId}/removeVolume`, body);
|
||||
}
|
||||
}
|
||||
if (Array.isArray(responseData)) {
|
||||
|
||||
Reference in New Issue
Block a user