fix(types) error are optional
This commit is contained in:
parent
42989944b3
commit
0289565025
@ -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(),
|
||||
|
@ -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(),
|
||||
|
@ -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(),
|
||||
|
@ -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(),
|
||||
|
@ -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(),
|
||||
|
@ -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(),
|
||||
|
@ -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(),
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user