Skip to content

Commit 2e87d50

Browse files
committed
fix: update adminforth dependency to version 3.8.2 and remove unused parseBody import
1 parent 91c2397 commit 2e87d50

3 files changed

Lines changed: 26 additions & 21 deletions

File tree

index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AdminForthPlugin, parseBody, AdminForthDataTypes, AdminForthResourcePages, Filters} from "adminforth";
1+
import { AdminForthPlugin, AdminForthDataTypes, AdminForthResourcePages, Filters} from "adminforth";
22
import type { IAdminForth, IHttpServer, AdminForthResourceColumn, AdminForthResource, IAdminForthHttpResponse, AdminUser, AdminForthComponentDeclaration } from "adminforth";
33
import type { PluginOptions } from './types.js';
44
import { error } from "console";
@@ -113,12 +113,10 @@ export default class UserSoftDelete extends AdminForthPlugin {
113113
server.endpoint({
114114
method: 'POST',
115115
path: `/plugin/${this.pluginInstanceId}/deactivateUser`,
116+
request_schema: deactivateUserBodySchema,
116117
handler: async ({ adminUser, body, response }) => {
117118
console.log(`UserSoftDelete: deactivateUser endpoint called by ${adminUser.dbUser[this.resourceConfig.columns.find((col) => col.primaryKey).name]}`);
118-
const parsed = parseBody(deactivateUserBodySchema, body, response);
119-
console.log(`UserSoftDelete: parsed body: ${JSON.stringify(parsed)}`);
120-
if ('error' in parsed) return parsed.error;
121-
const data = parsed.data;
119+
const data = body as z.infer<typeof deactivateUserBodySchema>;
122120
let isAllowedToDeactivate = false;
123121
if ( typeof this.allowDisableFunc === "function" ) {
124122
isAllowedToDeactivate = await this.allowDisableFunc(adminUser);

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
},
2121
"devDependencies": {
2222
"@types/node": "latest",
23-
"adminforth": "^3.7.1",
23+
"adminforth": "^3.8.2",
2424
"semantic-release": "^24.2.1",
2525
"semantic-release-slack-bot": "^4.0.2",
2626
"typescript": "^5.7.3"
2727
},
2828
"peerDependencies": {
29-
"adminforth": "^3.7.1"
29+
"adminforth": "^3.8.2"
3030
},
3131
"release": {
3232
"plugins": [

pnpm-lock.yaml

Lines changed: 21 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)