Compare commits
No commits in common. "ee8c3f4a3e889b3065d09900ce7e92092a21bec3" and "99addde632903653bdc9bd401ee0a00f0a9f43ad" have entirely different histories.
ee8c3f4a3e
...
99addde632
|
@ -826,6 +826,26 @@ export class Plutio implements INodeType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ('project' === resource) {
|
if ('project' === resource) {
|
||||||
|
if ('getCklph' === operation) {
|
||||||
|
const contributor = this.getNodeParameter('contributor', i) as IDataObject;
|
||||||
|
|
||||||
|
if (contributor) {
|
||||||
|
let contributorId;
|
||||||
|
const users = await plutioApiRequest.call(this, 'GET', '/people');
|
||||||
|
for (const user of users) {
|
||||||
|
if (user.contactEmails[0].address === contributor || contributor === user._id) {
|
||||||
|
contributorId = user._id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
qs.contributors = contributorId as string;
|
||||||
|
}
|
||||||
|
const project = await plutioApiRequest.call(this, 'GET', '/projects', {}, qs);
|
||||||
|
if (project.length === 1) {
|
||||||
|
responseData = project;
|
||||||
|
} else {
|
||||||
|
responseData = {'name': 'default'};
|
||||||
|
}
|
||||||
|
}
|
||||||
if ('get' === operation) {
|
if ('get' === operation) {
|
||||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,12 @@ export const projectOperations: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
options: [
|
options: [
|
||||||
|
// {
|
||||||
|
// name: 'Chykalophia',
|
||||||
|
// value: 'getCklph',
|
||||||
|
// description: 'Get projects by contributor\'s email for CKLPH',
|
||||||
|
// action: 'Get a project',
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
name: 'Copy',
|
name: 'Copy',
|
||||||
value: 'copy',
|
value: 'copy',
|
||||||
|
@ -54,7 +60,7 @@ export const projectOperations: INodeProperties[] = [
|
||||||
action: 'Update a project',
|
action: 'Update a project',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
default: 'get',
|
default: 'getCklph',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue