update handler errors to optional

This commit is contained in:
Edmond Lee 2020-05-25 11:22:39 -07:00
parent 5e14528a9a
commit 5293b2951f
8 changed files with 8 additions and 8 deletions

View File

@ -11,7 +11,7 @@ interface CompileBody {
format?: string; format?: string;
} }
const validateRequest = (body: any): { value: CompileBody; error: any } => { const validateRequest = (body: any): { value: CompileBody; error?: any } => {
return joi return joi
.object({ .object({
syntax: joi.string().required(), syntax: joi.string().required(),

View File

@ -10,7 +10,7 @@ interface CompileBody {
format?: string; format?: string;
} }
const validateRequest = (body: any): { value: CompileBody; error: any } => { const validateRequest = (body: any): { value: CompileBody; error?: any } => {
return joi return joi
.object({ .object({
syntax: joi.string().required(), syntax: joi.string().required(),

View File

@ -12,7 +12,7 @@ interface CompileBody {
format?: string; format?: string;
} }
const validateRequest = (body: any): { value: CompileBody; error: any } => { const validateRequest = (body: any): { value: CompileBody; error?: any } => {
return joi return joi
.object({ .object({
syntax: joi.string().required(), syntax: joi.string().required(),

View File

@ -15,7 +15,7 @@ interface DeployBody {
Tezos.setProvider({ rpc: 'https://api.tez.ie/rpc/carthagenet' }); 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 return joi
.object({ .object({
syntax: joi.string().required(), syntax: joi.string().required(),

View File

@ -12,7 +12,7 @@ interface DryRunBody {
storage: string; storage: string;
} }
const validateRequest = (body: any): { value: DryRunBody; error: any } => { const validateRequest = (body: any): { value: DryRunBody; error?: any } => {
return joi return joi
.object({ .object({
syntax: joi.string().required(), syntax: joi.string().required(),

View File

@ -12,7 +12,7 @@ interface EvaluateValueBody {
const validateRequest = ( const validateRequest = (
body: any body: any
): { value: EvaluateValueBody; error: any } => { ): { value: EvaluateValueBody; error?: any } => {
return joi return joi
.object({ .object({
syntax: joi.string().required(), syntax: joi.string().required(),

View File

@ -11,7 +11,7 @@ interface RunFunctionBody {
parameters: string; parameters: string;
} }
const validateRequest = (body: any): { value: RunFunctionBody; error: any } => { const validateRequest = (body: any): { value: RunFunctionBody; error?: any } => {
return joi return joi
.object({ .object({
syntax: joi.string().required(), syntax: joi.string().required(),

View File

@ -35,7 +35,7 @@ interface ShareBody {
}; };
} }
const validateRequest = (body: any): { value: ShareBody; error: any } => { const validateRequest = (body: any): { value: ShareBody; error?: any } => {
return joi return joi
.object({ .object({
editor: joi editor: joi