plenna_utilities 1.4.0 → 1.4.1

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.
@@ -24,7 +24,7 @@ export declare class PlennaGoogleService {
24
24
  authorization(): GoogleAuth<JSONClient>;
25
25
  getDocument(documentId: string): Promise<docs_v1.Schema$Document | undefined>;
26
26
  cloneDocument(documentId: string, folderId: string): Promise<cloneDocumentResponse>;
27
- buildPayload(template?: IPlennaGoogleBase[]): ISchemaRequest[];
27
+ buildPayload(template?: Array<Partial<IPlennaGoogleBase>>): ISchemaRequest[];
28
28
  updateDocument(id: string, requests?: ISchemaRequest[]): Promise<updateDocumentResponse>;
29
29
  exportDocumentAsUrl(fileId: string): Promise<string | undefined>;
30
30
  exportDocumentAsFile(fileId: string): Promise<ArrayBuffer | undefined>;
@@ -11,4 +11,4 @@ export interface IPlennaGoogleBase {
11
11
  rowIndex?: number;
12
12
  };
13
13
  }
14
- export declare const payloadBuilder: (template: IPlennaGoogleBase[]) => docs_v1.Schema$Request[];
14
+ export declare const payloadBuilder: (template: Array<Partial<IPlennaGoogleBase>>) => docs_v1.Schema$Request[];
@@ -47,9 +47,11 @@ const getPayload = (type, variable, value, rowToDelete) => {
47
47
  const payloadBuilder = (template) => {
48
48
  const payload = [];
49
49
  template.forEach(field => {
50
- const val = getPayload(field.doc_type, field.identifier, field.value, field.rowToDelete);
51
- if (val !== undefined) {
52
- payload.push(val);
50
+ if (field.doc_type !== undefined) {
51
+ const val = getPayload(field.doc_type, field.identifier, field.value, field.rowToDelete);
52
+ if (val !== undefined) {
53
+ payload.push(val);
54
+ }
53
55
  }
54
56
  });
55
57
  console.log(payload);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plenna_utilities",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "plenna's utils for backend projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",