Browse Source

Merge pull request #2025 from nocodb/fix/webhook-after-delete

fix: webhook-related issues
pull/2050/head
աɨռɢӄաօռɢ 2 years ago committed by GitHub
parent
commit
a63796ac1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nc-gui/components/project/spreadsheet/components/moreActions.vue
  2. 5
      packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSqlv2.ts

2
packages/nc-gui/components/project/spreadsheet/components/moreActions.vue

@ -104,7 +104,7 @@
:parsed-csv="parsedCsv"
@import="importData"
/>
<webhook-modal v-model="webhookModal" :meta="meta" />
<webhook-modal v-if="webhookModal" v-model="webhookModal" :meta="meta" />
</div>
</template>

5
packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSqlv2.ts

@ -1260,12 +1260,13 @@ class BaseModelSqlv2 {
async delByPk(id, trx?, cookie?) {
try {
// retrieve data for handling paramas in hook
const data = await this.readByPk(id);
await this.beforeDelete(id, trx, cookie);
const response = await this.dbDriver(this.tnPath)
.del()
.where(await this._wherePk(id));
await this.afterDelete(response, trx, cookie);
await this.afterDelete(data, trx, cookie);
return response;
} catch (e) {
console.log(e);

Loading…
Cancel
Save