@verdocs/js-sdk 6.2.0-beta.5 → 6.2.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2444,11 +2444,12 @@ const toggleTemplateStar = (endpoint, templateId) => endpoint.api //
2444
2444
  * @group Template Documents
2445
2445
  * @api POST /v2/templates/:template_id/documents Attach a document to a template
2446
2446
  * @apiBody string(format:binary) file Document file to attach. The file name will automatically be used as the document name.
2447
+ * @apiBody string(format:uuid) template_id Template ID to attach the document to
2447
2448
  * @apiSuccess ITemplateDocument . Template document
2448
2449
  */
2449
2450
  const createTemplateDocument = (endpoint, template_id, file, onUploadProgress) => {
2450
2451
  const formData = new FormData();
2451
- formData.append('document', file, file.name);
2452
+ formData.append('file', file, file.name);
2452
2453
  formData.append('template_id', template_id);
2453
2454
  return endpoint.api //
2454
2455
  .post(`/v2/template-documents`, formData, {
@@ -2608,6 +2609,7 @@ const isFieldFilled = (field, allRecipientFields) => {
2608
2609
  return false;
2609
2610
  }
2610
2611
  };
2612
+ // TODO: Only allow !required to bypass validation if the field is empty.
2611
2613
  const isFieldValid = (field, allRecipientFields) => {
2612
2614
  return !field.required || isFieldFilled(field, allRecipientFields);
2613
2615
  };