From 0289565025d984aa4d4c5f3fbce5ae3803c8702c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jev=20Bj=C3=B6rsell?= Date: Mon, 25 May 2020 11:35:09 -0700 Subject: [PATCH] fix(types) error are optional --- tools/webide/packages/server/src/handlers/compile-contract.ts | 2 +- tools/webide/packages/server/src/handlers/compile-expression.ts | 2 +- tools/webide/packages/server/src/handlers/compile-storage.ts | 2 +- tools/webide/packages/server/src/handlers/deploy.ts | 2 +- tools/webide/packages/server/src/handlers/dry-run.ts | 2 +- tools/webide/packages/server/src/handlers/evaluate-value.ts | 2 +- tools/webide/packages/server/src/handlers/run-function.ts | 2 +- tools/webide/packages/server/src/handlers/share.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/webide/packages/server/src/handlers/compile-contract.ts b/tools/webide/packages/server/src/handlers/compile-contract.ts index aaed33150..a33c445f4 100644 --- a/tools/webide/packages/server/src/handlers/compile-contract.ts +++ b/tools/webide/packages/server/src/handlers/compile-contract.ts @@ -11,7 +11,7 @@ interface CompileBody { format?: string; } -const validateRequest = (body: any): { value: CompileBody; error: any } => { +const validateRequest = (body: any): { value: CompileBody; error?: any } => { return joi .object({ syntax: joi.string().required(), diff --git a/tools/webide/packages/server/src/handlers/compile-expression.ts b/tools/webide/packages/server/src/handlers/compile-expression.ts index ece19eccc..5c179755d 100644 --- a/tools/webide/packages/server/src/handlers/compile-expression.ts +++ b/tools/webide/packages/server/src/handlers/compile-expression.ts @@ -10,7 +10,7 @@ interface CompileBody { format?: string; } -const validateRequest = (body: any): { value: CompileBody; error: any } => { +const validateRequest = (body: any): { value: CompileBody; error?: any } => { return joi .object({ syntax: joi.string().required(), diff --git a/tools/webide/packages/server/src/handlers/compile-storage.ts b/tools/webide/packages/server/src/handlers/compile-storage.ts index f0cc1a12b..7fa88c75d 100644 --- a/tools/webide/packages/server/src/handlers/compile-storage.ts +++ b/tools/webide/packages/server/src/handlers/compile-storage.ts @@ -12,7 +12,7 @@ interface CompileBody { format?: string; } -const validateRequest = (body: any): { value: CompileBody; error: any } => { +const validateRequest = (body: any): { value: CompileBody; error?: any } => { return joi .object({ syntax: joi.string().required(), diff --git a/tools/webide/packages/server/src/handlers/deploy.ts b/tools/webide/packages/server/src/handlers/deploy.ts index 6409c0da6..95c2f6852 100644 --- a/tools/webide/packages/server/src/handlers/deploy.ts +++ b/tools/webide/packages/server/src/handlers/deploy.ts @@ -15,7 +15,7 @@ interface DeployBody { Tezos.setProvider({ rpc: 'https://api.tez.ie/rpc/carthagenet' }); -const validateRequest = (body: any): { value: DeployBody; error: any } => { +const validateRequest = (body: any): { value: DeployBody; error?: any } => { return joi .object({ syntax: joi.string().required(), diff --git a/tools/webide/packages/server/src/handlers/dry-run.ts b/tools/webide/packages/server/src/handlers/dry-run.ts index 815d0c286..0edd1a856 100644 --- a/tools/webide/packages/server/src/handlers/dry-run.ts +++ b/tools/webide/packages/server/src/handlers/dry-run.ts @@ -12,7 +12,7 @@ interface DryRunBody { storage: string; } -const validateRequest = (body: any): { value: DryRunBody; error: any } => { +const validateRequest = (body: any): { value: DryRunBody; error?: any } => { return joi .object({ syntax: joi.string().required(), diff --git a/tools/webide/packages/server/src/handlers/evaluate-value.ts b/tools/webide/packages/server/src/handlers/evaluate-value.ts index 80ca504bf..4805b5cfe 100644 --- a/tools/webide/packages/server/src/handlers/evaluate-value.ts +++ b/tools/webide/packages/server/src/handlers/evaluate-value.ts @@ -12,7 +12,7 @@ interface EvaluateValueBody { const validateRequest = ( body: any -): { value: EvaluateValueBody; error: any } => { +): { value: EvaluateValueBody; error?: any } => { return joi .object({ syntax: joi.string().required(), diff --git a/tools/webide/packages/server/src/handlers/run-function.ts b/tools/webide/packages/server/src/handlers/run-function.ts index 0fbf95d9e..da64c787b 100644 --- a/tools/webide/packages/server/src/handlers/run-function.ts +++ b/tools/webide/packages/server/src/handlers/run-function.ts @@ -11,7 +11,7 @@ interface RunFunctionBody { parameters: string; } -const validateRequest = (body: any): { value: RunFunctionBody; error: any } => { +const validateRequest = (body: any): { value: RunFunctionBody; error?: any } => { return joi .object({ syntax: joi.string().required(), diff --git a/tools/webide/packages/server/src/handlers/share.ts b/tools/webide/packages/server/src/handlers/share.ts index 18bc13627..d8b282b8d 100644 --- a/tools/webide/packages/server/src/handlers/share.ts +++ b/tools/webide/packages/server/src/handlers/share.ts @@ -35,7 +35,7 @@ interface ShareBody { }; } -const validateRequest = (body: any): { value: ShareBody; error: any } => { +const validateRequest = (body: any): { value: ShareBody; error?: any } => { return joi .object({ editor: joi