Skip to content

Commit

Permalink
Merge pull request #163 from trustbit/fix/add-collaborator
Browse files Browse the repository at this point in the history
BC Connections fix  adding new collaborators
  • Loading branch information
K-Dud authored Mar 11, 2024
2 parents fcc59ad + 667ce68 commit 6f1613c
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,19 +226,19 @@ const schema = zod.object({
return { message: t("bounded_context_canvas.collaborators.connection.required") };
},
}),
collaboratorRef: zod.union([zod.string().min(1), zod.object({})]),
collaboratorRef: zod.union([zod.string().min(1), zod.object({}).passthrough()]),
description: zod.string(),
});
const validationSchema = toFormValidator(schema);
interface CollaboratorFormValue {
collaborator: CollaboratorKeys | unknown;
collaborator: CollaboratorKeys;
collaboratorRef: string | BoundedContext | Domain;
description: string;
}
const initialValues: CollaboratorFormValue = {
collaborator: "",
collaborator: "boundedContext",
collaboratorRef: "",
description: "",
};
Expand All @@ -248,9 +248,9 @@ const { values, handleSubmit, resetForm, setFieldValue } = useForm({
initialValues: initialValues,
});
const onSubmit = handleSubmit((formValue: CollaboratorFormValue) => {
createCollaborator(formValue);
resetForm();
const onSubmit = handleSubmit(async (formValue: CollaboratorFormValue) => {
await createCollaborator(formValue);
resetForm(initialValues);
});
function searchSuggestions(query: string): void {
Expand Down

0 comments on commit 6f1613c

Please sign in to comment.