mirror of
https://origin.cursor.com/mrdevmx/panels.git
synced 2026-10-09 15:33:17 +00:00
fix(api): corregir tipos en iam_http y warehouse_http para deno check
Co-authored-by: alberto.martinez <alberto.martinez@mrdev.mx>
This commit is contained in:
parent
ab89727522
commit
b8e97b5137
2 changed files with 4 additions and 4 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
import type { Hono } from "hono";
|
import type { Hono } from "hono";
|
||||||
import type { AuthUser } from "./auth.ts";
|
import type { AuthUser } from "./auth.ts";
|
||||||
import { requireAuth, tenantScope } from "./auth.ts";
|
import { requireAuth, tenantScope } from "./auth.ts";
|
||||||
import { callCoreFn } from "./rpc.ts";
|
import type { Db } from "./db.ts";
|
||||||
import { respondRpc, routeLabel } from "./http_errors.ts";
|
import { respondRpc } from "./http_errors.ts";
|
||||||
import { requirePermission, callIamFn } from "./permissions.ts";
|
import { requirePermission, callIamFn } from "./permissions.ts";
|
||||||
|
|
||||||
type App = Hono<{ Variables: { user: AuthUser } }>;
|
type App = Hono<{ Variables: { user: AuthUser; db: Db } }>;
|
||||||
|
|
||||||
export function registerIamRoutes(app: App) {
|
export function registerIamRoutes(app: App) {
|
||||||
app.get("/v1/iam/users", requireAuth, requirePermission("manage_users"), async (c) => {
|
app.get("/v1/iam/users", requireAuth, requirePermission("manage_users"), async (c) => {
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ export function registerWarehouseRoutes(app: App) {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post("/v1/projects/:id/warehouse/close", ...requireCoreAuth, requirePermission("close_warehouse"), async (c) => {
|
app.post("/v1/projects/:id/warehouse/close", ...requireCoreAuth, requirePermission("close_warehouse"), async (c) => {
|
||||||
const body = await c.req.json<Record<string, unknown>>().catch(() => ({}));
|
const body = await c.req.json<{ force?: boolean; close_notes?: string }>().catch(() => ({} as { force?: boolean; close_notes?: string }));
|
||||||
const db = c.get("db");
|
const db = c.get("db");
|
||||||
const a = actor(c);
|
const a = actor(c);
|
||||||
const env = await callCoreFn(db, "core.fn_warehouse_close_project", {
|
const env = await callCoreFn(db, "core.fn_warehouse_close_project", {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue