From 631f077c1870de57b6d59ca70e91fe58b3ceb34f Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Mon, 3 Jun 2024 13:17:01 -0400 Subject: [PATCH] fix(editor): Type errors in `VariablesView.vue` (no-changelog) (#9558) --- packages/editor-ui/src/Interface.ts | 6 +- packages/editor-ui/src/api/environments.ee.ts | 4 +- .../editor-ui/src/components/VariablesRow.vue | 31 +++---- .../components/__tests__/VariablesRow.spec.ts | 9 +- .../layouts/ResourcesListLayout.vue | 5 +- .../editor-ui/src/views/VariablesView.vue | 82 ++++++++++++------- 6 files changed, 79 insertions(+), 58 deletions(-) diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 9a58bed13c..f3d536cc4f 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -1661,15 +1661,11 @@ export declare namespace DynamicNodeParameters { } export interface EnvironmentVariable { - id: number; + id: string; key: string; value: string; } -export interface TemporaryEnvironmentVariable extends Omit { - id: string; -} - export type ExecutionFilterMetadata = { key: string; value: string; diff --git a/packages/editor-ui/src/api/environments.ee.ts b/packages/editor-ui/src/api/environments.ee.ts index e24e02c30d..a6a6bba632 100644 --- a/packages/editor-ui/src/api/environments.ee.ts +++ b/packages/editor-ui/src/api/environments.ee.ts @@ -16,14 +16,14 @@ export async function getVariable( export async function createVariable( context: IRestApiContext, data: Omit, -) { +): Promise { return await makeRestApiRequest(context, 'POST', '/variables', data as unknown as IDataObject); } export async function updateVariable( context: IRestApiContext, { id, ...data }: EnvironmentVariable, -) { +): Promise { return await makeRestApiRequest( context, 'PATCH', diff --git a/packages/editor-ui/src/components/VariablesRow.vue b/packages/editor-ui/src/components/VariablesRow.vue index 4afd515055..0ddbe58c33 100644 --- a/packages/editor-ui/src/components/VariablesRow.vue +++ b/packages/editor-ui/src/components/VariablesRow.vue @@ -1,7 +1,7 @@