Skip to content

Commit c3a7a73

Browse files
committed
fix: delete unused arguments from function
1 parent a48d0a7 commit c3a7a73

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

adminforth/modules/configValidator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ export default class ConfigValidator implements IConfigValidator {
283283
}
284284

285285
const restApi = new AdminForthRestAPI (this.adminforth)
286-
restApi.deleteWithCascade(res as AdminForthResource, recordId, { adminUser, response, body: undefined, query: undefined, headers: undefined, cookies: undefined, requestUrl: undefined});
286+
restApi.deleteWithCascade(res as AdminForthResource, recordId, { adminUser, response, body: null,});
287287

288288
await Promise.all(
289289
(res.hooks.delete.afterSave).map(

adminforth/modules/restApi.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
153153
}
154154
}
155155
}
156-
async deleteWithCascade(resource: AdminForthResource, primaryKey: any, context: {body: any, adminUser: any, query: any, headers: any, cookies: any, requestUrl: any, response: any}) {
156+
async deleteWithCascade(resource: AdminForthResource, primaryKey: any, context: {body: any, adminUser: any, response: any}) {
157157
const { adminUser, response } = context;
158158

159159
const record = await this.adminforth.connectors[resource.dataSource].getRecordByPrimaryKey(resource, primaryKey);
@@ -187,7 +187,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
187187
}
188188
}
189189

190-
await this.adminforth.deleteResourceRecord({resource, record, adminUser, recordId: primaryKey, response, extra: context});
190+
await this.adminforth.deleteResourceRecord({resource, record, adminUser, recordId: primaryKey, response});
191191
}
192192

193193
registerEndpoints(server: IHttpServer) {
@@ -1518,7 +1518,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
15181518
return { error };
15191519
}
15201520

1521-
await this.deleteWithCascade(resource, body.primaryKey, {body, adminUser, query, headers, cookies, requestUrl, response});
1521+
await this.deleteWithCascade(resource, body.primaryKey, {body, adminUser, response});
15221522

15231523
const { error: deleteError } = await this.adminforth.deleteResourceRecord({
15241524
resource, record, adminUser, recordId: body['primaryKey'], response,

0 commit comments

Comments
 (0)