We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9f27b5 commit 4d76bd5Copy full SHA for 4d76bd5
1 file changed
apps/webapp/app/routes/api.v1.batches.ts
@@ -0,0 +1,24 @@
1
+import { json } from "@remix-run/server-runtime";
2
+import {
3
+ ApiBatchListPresenter,
4
+ ApiBatchListSearchParams,
5
+} from "~/presenters/v3/ApiBatchListPresenter.server";
6
+import { createLoaderApiRoute } from "~/services/routeBuilders/apiBuilder.server";
7
+
8
+export const loader = createLoaderApiRoute(
9
+ {
10
+ searchParams: ApiBatchListSearchParams,
11
+ allowJWT: true,
12
+ corsStrategy: "all",
13
+ authorization: {
14
+ action: "read",
15
+ resource: () => ({ type: "runs" }),
16
+ },
17
+ findResource: async () => 1,
18
19
+ async ({ searchParams, authentication }) => {
20
+ const presenter = new ApiBatchListPresenter();
21
+ const result = await presenter.call(authentication.environment, searchParams);
22
+ return json(result);
23
+ }
24
+);
0 commit comments