- finished add_document on Zapier interface

This commit is contained in:
Josako
2024-12-13 10:40:57 +01:00
parent 46c60b36a0
commit 3176b95323
2 changed files with 29 additions and 18 deletions

View File

@@ -35,7 +35,7 @@ module.exports = {
label: 'Document Name',
type: 'string',
helpText: 'The name you want to give the Document.',
required: false,
required: true,
list: false,
altersDynamicFields: false,
},
@@ -136,16 +136,16 @@ module.exports = {
Object.assign(baseMetadata, bundle.inputData.additional_metadata);
}
// Get the file content
const filePromise = z.stashFile(bundle.inputData.file);
const file = await filePromise;
// const temp_url = z.stashFile(bundle.inputData.file);
// Get the file URL from Zapier
const tempFileUrl = await z.stashFile(bundle.inputData.file);
// Log the temporary URL for debugging
z.console.log('Temporary URL created:', tempFileUrl);
// Create request data as an object
const requestData = {
catalog_id: bundle.inputData.catalog_id,
language: bundle.inputData.language,
temp_url: file, // This will be handled by z.request automatically
temp_url: tempFileUrl,
user_metadata: JSON.stringify(baseMetadata),
};