|
|
@ -4000,7 +4000,7 @@ class BaseModelSqlv2 { |
|
|
|
: await this.dbDriver.raw(query); |
|
|
|
: await this.dbDriver.raw(query); |
|
|
|
|
|
|
|
|
|
|
|
// update attachment fields
|
|
|
|
// update attachment fields
|
|
|
|
data = this.convertAttachmentType(data, childTable); |
|
|
|
data = await this.convertAttachmentType(data, childTable); |
|
|
|
|
|
|
|
|
|
|
|
// update date time fields
|
|
|
|
// update date time fields
|
|
|
|
data = this.convertDateFormat(data, childTable); |
|
|
|
data = this.convertDateFormat(data, childTable); |
|
|
@ -4024,7 +4024,16 @@ class BaseModelSqlv2 { |
|
|
|
return d; |
|
|
|
return d; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public convertAttachmentType(data: Record<string, any>, childTable?: Model) { |
|
|
|
public async convertAttachmentType( |
|
|
|
|
|
|
|
data: Record<string, any>, |
|
|
|
|
|
|
|
childTable?: Model, |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
if (childTable && !childTable?.columns) { |
|
|
|
|
|
|
|
await childTable.getColumns(); |
|
|
|
|
|
|
|
} else if (!this.model?.columns) { |
|
|
|
|
|
|
|
await this.model.getColumns(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// attachment is stored in text and parse in UI
|
|
|
|
// attachment is stored in text and parse in UI
|
|
|
|
// convertAttachmentType is used to convert the response in string to array of object in API response
|
|
|
|
// convertAttachmentType is used to convert the response in string to array of object in API response
|
|
|
|
if (data) { |
|
|
|
if (data) { |
|
|
|