mirror of
https://github.com/moghtech/komodo.git
synced 2026-04-30 14:25:22 -05:00
fix ts types
This commit is contained in:
@@ -36,16 +36,16 @@ const NewProcedure = ({ parent }: { parent?: Types.Procedure }) => {
|
|||||||
|
|
||||||
const { mutateAsync } = useWrite("CreateProcedure", {
|
const { mutateAsync } = useWrite("CreateProcedure", {
|
||||||
onSuccess: ({ _id }) => {
|
onSuccess: ({ _id }) => {
|
||||||
if (!parent) return;
|
if (!parent?._id?.$oid || !_id?.$oid) return;
|
||||||
if (
|
if (
|
||||||
parent.config.type === "Sequence" ||
|
parent.config.type === "Sequence" ||
|
||||||
parent.config.type === "Parallel"
|
parent.config.type === "Parallel"
|
||||||
) {
|
) {
|
||||||
update_parent({
|
update_parent({
|
||||||
id: parent._id?.$oid!,
|
id: parent._id.$oid,
|
||||||
config: {
|
config: {
|
||||||
...parent.config,
|
...parent.config,
|
||||||
data: [...parent.config.data, _id?.$oid!],
|
data: [...parent.config.data, _id?.$oid],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -283,9 +283,13 @@ const ExecutionConfig = ({ id }: { id: string }) => {
|
|||||||
const procedure = useRead("GetProcedure", { id }).data;
|
const procedure = useRead("GetProcedure", { id }).data;
|
||||||
if (procedure?.config.type !== "Execution") return null;
|
if (procedure?.config.type !== "Execution") return null;
|
||||||
|
|
||||||
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||||
const [type, setType] = useState<ExecutionType>(procedure.config.data.type);
|
const [type, setType] = useState<ExecutionType>(procedure.config.data.type);
|
||||||
|
|
||||||
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||||
const [params, setParams] = useState(procedure.config.data.params);
|
const [params, setParams] = useState(procedure.config.data.params);
|
||||||
|
|
||||||
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (procedure?.config.type !== "Execution") return;
|
if (procedure?.config.type !== "Execution") return;
|
||||||
if (type !== procedure.config.data.type) {
|
if (type !== procedure.config.data.type) {
|
||||||
@@ -329,6 +333,7 @@ const ExecutionConfig = ({ id }: { id: string }) => {
|
|||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
<div className="pt-2 border-t">
|
<div className="pt-2 border-t">
|
||||||
|
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
|
||||||
<Component params={params as any} setParams={setParams as any} />
|
<Component params={params as any} setParams={setParams as any} />
|
||||||
</div>
|
</div>
|
||||||
<div className="pt-2 border-t">
|
<div className="pt-2 border-t">
|
||||||
|
|||||||
Reference in New Issue
Block a user