Fix bugs with workspaces query, form and mutation

This commit is contained in:
Hakan Shehu
2024-10-27 19:19:32 +01:00
parent 7b699b2b1e
commit ade9cdde28
3 changed files with 4 additions and 4 deletions

View File

@@ -33,7 +33,7 @@ export class WorkspaceListQueryHandler
): Promise<ChangeCheckResult<WorkspaceListQueryInput>> {
if (
!changes.some(
(change) => change.type === 'app' && change.table === 'accounts',
(change) => change.type === 'app' && change.table === 'workspaces',
)
) {
return {

View File

@@ -32,8 +32,8 @@ export const WorkspaceCreate = () => {
accountId: account.id,
avatar: values.avatar,
},
onSuccess(id) {
navigate(`/${id}`);
onSuccess(output) {
navigate(`/${output.id}`);
},
onError() {
toast({

View File

@@ -25,7 +25,7 @@ import { Upload } from 'lucide-react';
const formSchema = z.object({
name: z.string().min(3, 'Name must be at least 3 characters long.'),
description: z.string(),
avatar: z.string().optional(),
avatar: z.string().optional().nullable(),
});
type formSchemaType = z.infer<typeof formSchema>;