feat: passando todos os parametros nas chamadas de metodo
This commit is contained in:
parent
c2feb1c8e1
commit
436b5c5b7f
1 changed files with 15 additions and 23 deletions
|
@ -180,51 +180,43 @@ export class LhispOauthClient<iAccessToken extends AccessToken = AccessToken> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async get<ResponseType>({ path, contentType = ContentType.APPLICATION_JSON, params }: ExecutarRequestParams) {
|
async get<ResponseType>(opt: ExecutarRequestParams) {
|
||||||
return this.executarRequest<ResponseType>({
|
return this.executarRequest<ResponseType>({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
path,
|
contentType: opt.contentType || ContentType.APPLICATION_JSON,
|
||||||
contentType,
|
...opt,
|
||||||
params,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async put<ResponseType>({ path, data, params, contentType = ContentType.APPLICATION_JSON }: ExecutarRequestParams) {
|
async put<ResponseType>(opt: ExecutarRequestParams) {
|
||||||
return this.executarRequest<ResponseType>({
|
return this.executarRequest<ResponseType>({
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
path,
|
contentType: opt.contentType || ContentType.APPLICATION_JSON,
|
||||||
data,
|
...opt,
|
||||||
params,
|
|
||||||
contentType,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async patch<ResponseType>({ path, data, params, contentType = ContentType.APPLICATION_JSON }: ExecutarRequestParams) {
|
async patch<ResponseType>(opt: ExecutarRequestParams) {
|
||||||
return this.executarRequest<ResponseType>({
|
return this.executarRequest<ResponseType>({
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
path,
|
contentType: opt.contentType || ContentType.APPLICATION_JSON,
|
||||||
data,
|
...opt,
|
||||||
params,
|
|
||||||
contentType,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async post<ResponseType>({ path, data, params, contentType = ContentType.APPLICATION_JSON }: ExecutarRequestParams) {
|
async post<ResponseType>(opt: ExecutarRequestParams) {
|
||||||
return this.executarRequest<ResponseType>({
|
return this.executarRequest<ResponseType>({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
path,
|
contentType: opt.contentType || ContentType.APPLICATION_JSON,
|
||||||
data,
|
...opt,
|
||||||
params,
|
|
||||||
contentType,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async delete<ResponseType>({ path, params, contentType = ContentType.APPLICATION_JSON }: ExecutarRequestParams) {
|
async delete<ResponseType>(opt: ExecutarRequestParams) {
|
||||||
return this.executarRequest<ResponseType>({
|
return this.executarRequest<ResponseType>({
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
path,
|
contentType: opt.contentType || ContentType.APPLICATION_JSON,
|
||||||
params,
|
...opt,
|
||||||
contentType,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue