chore(root): rename organizationSlug to organizationId (#91)
This commit is contained in:
committed by
GitHub
parent
0221948aab
commit
cd16ac878d
@@ -4,7 +4,7 @@ import {
|
||||
db,
|
||||
getId,
|
||||
getProjectByIdCached,
|
||||
getProjectsByOrganizationSlug,
|
||||
getProjectsByOrganizationId,
|
||||
} from '@openpanel/db';
|
||||
|
||||
import { getProjectAccess } from '../access';
|
||||
@@ -15,12 +15,12 @@ export const projectRouter = createTRPCRouter({
|
||||
list: protectedProcedure
|
||||
.input(
|
||||
z.object({
|
||||
organizationSlug: z.string().nullable(),
|
||||
organizationId: z.string().nullable(),
|
||||
}),
|
||||
)
|
||||
.query(async ({ input: { organizationSlug } }) => {
|
||||
if (organizationSlug === null) return [];
|
||||
return getProjectsByOrganizationSlug(organizationSlug);
|
||||
.query(async ({ input: { organizationId } }) => {
|
||||
if (organizationId === null) return [];
|
||||
return getProjectsByOrganizationId(organizationId);
|
||||
}),
|
||||
|
||||
update: protectedProcedure
|
||||
@@ -54,15 +54,14 @@ export const projectRouter = createTRPCRouter({
|
||||
.input(
|
||||
z.object({
|
||||
name: z.string().min(1),
|
||||
organizationSlug: z.string(),
|
||||
organizationId: z.string(),
|
||||
}),
|
||||
)
|
||||
.mutation(async ({ input: { name, organizationSlug } }) => {
|
||||
.mutation(async ({ input: { name, organizationId } }) => {
|
||||
return db.project.create({
|
||||
data: {
|
||||
id: await getId('project', name),
|
||||
organizationSlug: organizationSlug,
|
||||
organizationId: organizationSlug,
|
||||
organizationId,
|
||||
name: name,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user