Skip to content

Commit

Permalink
Make collection id required (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
wintonzheng authored Oct 23, 2024
1 parent 2798c4c commit d6c1618
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function WorkflowParameterAddPanel({ type, onClose, onSave }: Props) {
} catch (e) {
toast({
variant: "destructive",
title: "Failed to save parameters",
title: "Failed to add parameter",
description: "Invalid JSON for default value",
});
return;
Expand All @@ -227,6 +227,14 @@ function WorkflowParameterAddPanel({ type, onClose, onSave }: Props) {
});
}
if (type === "credential") {
if (!collectionId) {
toast({
variant: "destructive",
title: "Failed to add parameter",
description: "Collection ID is required",
});
return;
}
onSave({
key,
parameterType: "credential",
Expand All @@ -239,7 +247,7 @@ function WorkflowParameterAddPanel({ type, onClose, onSave }: Props) {
if (!sourceParameterKey) {
toast({
variant: "destructive",
title: "Failed to save parameters",
title: "Failed to add parameter",
description: "Source parameter key is required",
});
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function WorkflowParameterEditPanel({
} catch (e) {
toast({
variant: "destructive",
title: "Failed to save parameters",
title: "Failed to save parameter",
description: "Invalid JSON for default value",
});
return;
Expand All @@ -260,6 +260,14 @@ function WorkflowParameterEditPanel({
});
}
if (type === "credential") {
if (!collectionId) {
toast({
variant: "destructive",
title: "Failed to save parameter",
description: "Collection ID is required",
});
return;
}
onSave({
key,
parameterType: "credential",
Expand All @@ -272,7 +280,7 @@ function WorkflowParameterEditPanel({
if (!sourceParameterKey) {
toast({
variant: "destructive",
title: "Failed to save parameters",
title: "Failed to save parameter",
description: "Source parameter key is required",
});
return;
Expand Down

0 comments on commit d6c1618

Please sign in to comment.