Skip to content

Commit d09b50b

Browse files
committed
fix: update adminforth dependency to version 3.8.2 and remove redundant parseBody import
1 parent 9e38eb7 commit d09b50b

3 files changed

Lines changed: 14 additions & 15 deletions

File tree

index.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ActionCheckSource, AdminForthPlugin, parseBody, interpretResource } from "adminforth";
1+
import { ActionCheckSource, AdminForthPlugin, interpretResource } from "adminforth";
22
import type { IAdminForth, IHttpServer, AdminForthResourcePages, AdminForthResourceColumn, AdminForthDataTypes, AdminForthResource } from "adminforth";
33
import type { PluginOptions } from './types.js';
44
import { z } from "zod";
@@ -76,10 +76,9 @@ export default class InlineCreatePlugin extends AdminForthPlugin {
7676
server.endpoint({
7777
method: 'POST',
7878
path: `/plugin/${this.pluginInstanceId}/create`,
79-
handler: async ({ body, adminUser, response }) => {
80-
const parsed = parseBody(createBodySchema, body, response);
81-
if ('error' in parsed) return parsed.error;
82-
const data = parsed.data;
79+
request_schema: createBodySchema,
80+
handler: async ({ body, adminUser }) => {
81+
const data = body as z.infer<typeof createBodySchema>;
8382
const { record, resourceId } = data;
8483

8584
if (!record) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
"license": "MIT",
2424
"description": "Inline create plugin for adminforth",
2525
"peerDependencies": {
26-
"adminforth": "^3.7.1"
26+
"adminforth": "^3.8.2"
2727
},
2828
"dependencies": {
2929
"zod": "^4.3.6"
3030
},
3131
"devDependencies": {
3232
"@types/node": "^22.10.7",
33-
"adminforth": "^3.7.1",
33+
"adminforth": "^3.8.2",
3434
"semantic-release": "^24.2.1",
3535
"semantic-release-slack-bot": "^4.0.2",
3636
"typescript": "^5.7.3"

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)