Skip to content

Commit 2d23edd

Browse files
committed
fix: update adminforth dependency to version 3.8.2 and refactor request body handling in start_bulk_action endpoint
1 parent 0e1b718 commit 2d23edd

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
@@ -5,7 +5,7 @@ import type {
55
} from "adminforth";
66
import clone from 'clone';
77

8-
import { AdminForthPlugin, parseBody, AdminForthResourcePages, suggestIfTypo } from "adminforth";
8+
import { AdminForthPlugin, AdminForthResourcePages, suggestIfTypo } from "adminforth";
99
import { PluginOptions } from "./types.js";
1010
import { interpretResource, ActionCheckSource } from "adminforth";
1111
import { z } from "zod";
@@ -62,10 +62,9 @@ export default class ForeignInlineShowPlugin extends AdminForthPlugin {
6262
server.endpoint({
6363
method: 'POST',
6464
path: `/plugin/${this.pluginInstanceId}/start_bulk_action`,
65-
handler: async ({ body, adminUser, tr, response: httpResponse }) => {
66-
const parsed = parseBody(startBulkActionBodySchema, body, httpResponse);
67-
if ('error' in parsed) return parsed.error;
68-
const data = parsed.data;
65+
request_schema: startBulkActionBodySchema,
66+
handler: async ({ body, adminUser, tr }) => {
67+
const data = body as z.infer<typeof startBulkActionBodySchema>;
6968
const { resourceId, actionId, recordIds } = data;
7069
const resource = this.adminforth.config.resources.find((res) => res.resourceId == resourceId);
7170
if (!resource) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
"license": "MIT",
2222
"devDependencies": {
2323
"@types/node": "^22.10.7",
24-
"adminforth": "^3.7.1",
24+
"adminforth": "^3.8.2",
2525
"semantic-release": "^24.2.1",
2626
"semantic-release-slack-bot": "^4.0.2",
2727
"typescript": "^5.7.3"
2828
},
2929
"peerDependencies": {
30-
"adminforth": "^3.7.1"
30+
"adminforth": "^3.8.2"
3131
},
3232
"release": {
3333
"plugins": [

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)