fix(types) error are optional

This commit is contained in:
Jev Björsell 2020-05-25 11:35:09 -07:00
parent 42989944b3
commit 0289565025
No known key found for this signature in database
GPG Key ID: 03F50CB91981EC9E
8 changed files with 8 additions and 8 deletions

View File

@ -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(),

View File

@ -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(),

View File

@ -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(),

View File

@ -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(),

View File

@ -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(),

View File

@ -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(),

View File

@ -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(),

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
.object({
editor: joi