|
|
@ -28,6 +28,7 @@ export interface Row { |
|
|
|
new?: boolean |
|
|
|
new?: boolean |
|
|
|
selected?: boolean |
|
|
|
selected?: boolean |
|
|
|
commentCount?: number |
|
|
|
commentCount?: number |
|
|
|
|
|
|
|
changed?: boolean |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -210,6 +211,7 @@ export function useViewData( |
|
|
|
await syncCount() |
|
|
|
await syncCount() |
|
|
|
return insertedData |
|
|
|
return insertedData |
|
|
|
} catch (error: any) { |
|
|
|
} catch (error: any) { |
|
|
|
|
|
|
|
console.log(error) |
|
|
|
message.error(await extractSdkResponseErrorMsg(error)) |
|
|
|
message.error(await extractSdkResponseErrorMsg(error)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -241,7 +243,8 @@ export function useViewData( |
|
|
|
value: getHTMLEncodedText(toUpdate.row[property]), |
|
|
|
value: getHTMLEncodedText(toUpdate.row[property]), |
|
|
|
prev_value: getHTMLEncodedText(toUpdate.oldRow[property]), |
|
|
|
prev_value: getHTMLEncodedText(toUpdate.oldRow[property]), |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(() => {}) |
|
|
|
.then(() => { |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
/** update row data(to sync formula and other related columns) */ |
|
|
|
/** update row data(to sync formula and other related columns) */ |
|
|
|
Object.assign(toUpdate.row, updatedRowData) |
|
|
|
Object.assign(toUpdate.row, updatedRowData) |
|
|
@ -267,7 +270,7 @@ export function useViewData( |
|
|
|
|
|
|
|
|
|
|
|
async function deleteRowById(id: string) { |
|
|
|
async function deleteRowById(id: string) { |
|
|
|
if (!id) { |
|
|
|
if (!id) { |
|
|
|
throw new Error("Delete not allowed for table which doesn't have primary Key") |
|
|
|
throw new Error('Delete not allowed for table which doesn\'t have primary Key') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const res: any = await $api.dbViewRow.delete( |
|
|
|
const res: any = await $api.dbViewRow.delete( |
|
|
@ -280,11 +283,9 @@ export function useViewData( |
|
|
|
|
|
|
|
|
|
|
|
if (res.message) { |
|
|
|
if (res.message) { |
|
|
|
message.info( |
|
|
|
message.info( |
|
|
|
`Row delete failed: ${h('div', { |
|
|
|
`Row delete failed: ${`Unable to delete row with ID ${id} because of the following:
|
|
|
|
innerHTML: `<div style="padding:10px 4px">Unable to delete row with ID ${id} because of the following:
|
|
|
|
\n${res.message.join('\n')}.\n |
|
|
|
<br><br>${res.message.join('<br>')}<br><br> |
|
|
|
Clear the data first & try again`})}`, |
|
|
|
Clear the data first & try again</div>`,
|
|
|
|
|
|
|
|
})}`,
|
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
return false |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|