Version: 3.5.x
Put REST request (response structured)
import Joi from "joi";
import { RestRequest, IResponse } from "@mihanizm56/fetch-api";
export const putContractsRequest = (): Promise<IResponse> =>
new RestRequest().putRequest({
endpoint: "http://localhost:3000",
responseSchema: Joi.object({
username: Joi.string().required(),
password: Joi.string().required(),
info: Joi.object({
count: Joi.number().required(),
killers: Joi.array().items(
Joi.object({
username: Joi.string().required(),
count: Joi.number().required(),
})
),
}),
}),
});