feat: update workspace slug
This commit is contained in:
@@ -119,7 +119,8 @@ export const workspaceRouter = createTRPCRouter({
|
||||
.input(
|
||||
z.object({
|
||||
workspacePublicId: z.string().min(12),
|
||||
name: z.string().min(3).max(24),
|
||||
name: z.string().min(3).max(24).optional(),
|
||||
slug: z.string().min(3).max(24).optional(),
|
||||
}),
|
||||
)
|
||||
.output(z.custom<Awaited<ReturnType<typeof workspaceRepo.update>>>())
|
||||
@@ -128,6 +129,7 @@ export const workspaceRouter = createTRPCRouter({
|
||||
ctx.db,
|
||||
input.workspacePublicId,
|
||||
input.name,
|
||||
input.slug,
|
||||
);
|
||||
|
||||
return result;
|
||||
|
||||
@@ -42,11 +42,12 @@ export const create = async (
|
||||
export const update = async (
|
||||
db: SupabaseClient<Database>,
|
||||
workspacePublicId: string,
|
||||
name: string,
|
||||
name: string | undefined,
|
||||
slug: string | undefined,
|
||||
) => {
|
||||
const { data } = await db
|
||||
.from("workspace")
|
||||
.update({ name })
|
||||
.update({ name, slug })
|
||||
.eq("publicId", workspacePublicId)
|
||||
.is("deletedAt", null);
|
||||
|
||||
@@ -110,7 +111,8 @@ export const getAllByUserId = async (
|
||||
role,
|
||||
workspace (
|
||||
publicId,
|
||||
name
|
||||
name,
|
||||
slug
|
||||
)
|
||||
`,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user