From a3e47004711dd2a945c78a8d3120d14db7aaa1ae Mon Sep 17 00:00:00 2001 From: yokotaso Date: Sun, 17 May 2020 10:49:33 +0900 Subject: [PATCH] Fix Issue#264 Make id and type optional properties --- resources/testfields.d.ts | 8 ++++---- src/templates/expressions/fields.test.ts | 4 ++-- src/templates/expressions/fields.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/testfields.d.ts b/resources/testfields.d.ts index d24bfaa4..784fa476 100644 --- a/resources/testfields.d.ts +++ b/resources/testfields.d.ts @@ -18,9 +18,9 @@ declare namespace kintone.types { Group_selection: kintone.fieldTypes.GroupSelect; Attachment: kintone.fieldTypes.File; Table: { - type: "SUBTABLE"; + type?: "SUBTABLE"; value: { - id: string; + id?: string; value: { Text_Table: kintone.fieldTypes.SingleLineText; Rich_text_Table: kintone.fieldTypes.RichText; @@ -31,9 +31,9 @@ declare namespace kintone.types { }[]; }; Table_0: { - type: "SUBTABLE"; + type?: "SUBTABLE"; value: { - id: string; + id?: string; value: { Radio_button_Table: kintone.fieldTypes.RadioButton; Drop_down_Table: kintone.fieldTypes.DropDown; diff --git a/src/templates/expressions/fields.test.ts b/src/templates/expressions/fields.test.ts index e881decb..ced94617 100644 --- a/src/templates/expressions/fields.test.ts +++ b/src/templates/expressions/fields.test.ts @@ -102,9 +102,9 @@ describe("SubTableField", () => { ).toEqual( ` "fieldName" : { - type: "SUBTABLE"; + type?: "SUBTABLE"; value: { - id: string; + id?: string; value: { } diff --git a/src/templates/expressions/fields.ts b/src/templates/expressions/fields.ts index f225def4..f9d89917 100644 --- a/src/templates/expressions/fields.ts +++ b/src/templates/expressions/fields.ts @@ -51,9 +51,9 @@ export class SubTableField implements TsExpression { tsExpression(): string { return ` "${this.fieldName}" : { - type: "${this.fieldType}"; + type?: "${this.fieldType}"; value: { - id: string; + id?: string; value: { ${this.fieldGroup.tsExpression()} }