mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-24 22:06:38 +00:00
add roles input on resource and make spacing more consistent
This commit is contained in:
@@ -15,6 +15,7 @@ import createHttpError from "http-errors";
|
||||
import { eq, and } from "drizzle-orm";
|
||||
import stoi from "@server/utils/stoi";
|
||||
import { fromError } from "zod-validation-error";
|
||||
import { subdomainSchema } from "@server/schemas/subdomainSchema";
|
||||
|
||||
const createResourceParamsSchema = z.object({
|
||||
siteId: z
|
||||
@@ -28,7 +29,7 @@ const createResourceParamsSchema = z.object({
|
||||
const createResourceSchema = z
|
||||
.object({
|
||||
name: z.string().min(1).max(255),
|
||||
subdomain: z.string().min(1).max(255).optional(),
|
||||
subdomain: subdomainSchema,
|
||||
})
|
||||
.strict();
|
||||
|
||||
@@ -87,12 +88,9 @@ export async function createResource(
|
||||
);
|
||||
}
|
||||
|
||||
const fullDomain = `${subdomain}.${org[0].domain}`;
|
||||
|
||||
const newResource = await db
|
||||
.insert(resources)
|
||||
.values({
|
||||
fullDomain,
|
||||
siteId,
|
||||
orgId,
|
||||
name,
|
||||
|
||||
Reference in New Issue
Block a user