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>({
|
||||
method: "GET",
|
||||
path,
|
||||
contentType,
|
||||
params,
|
||||
contentType: opt.contentType || ContentType.APPLICATION_JSON,
|
||||
...opt,
|
||||
});
|
||||
}
|
||||
|
||||
async put<ResponseType>({ path, data, params, contentType = ContentType.APPLICATION_JSON }: ExecutarRequestParams) {
|
||||
async put<ResponseType>(opt: ExecutarRequestParams) {
|
||||
return this.executarRequest<ResponseType>({
|
||||
method: "PUT",
|
||||
path,
|
||||
data,
|
||||
params,
|
||||
contentType,
|
||||
contentType: opt.contentType || ContentType.APPLICATION_JSON,
|
||||
...opt,
|
||||
});
|
||||
}
|
||||
|
||||
async patch<ResponseType>({ path, data, params, contentType = ContentType.APPLICATION_JSON }: ExecutarRequestParams) {
|
||||
async patch<ResponseType>(opt: ExecutarRequestParams) {
|
||||
return this.executarRequest<ResponseType>({
|
||||
method: "PATCH",
|
||||
path,
|
||||
data,
|
||||
params,
|
||||
contentType,
|
||||
contentType: opt.contentType || ContentType.APPLICATION_JSON,
|
||||
...opt,
|
||||
});
|
||||
}
|
||||
|
||||
async post<ResponseType>({ path, data, params, contentType = ContentType.APPLICATION_JSON }: ExecutarRequestParams) {
|
||||
async post<ResponseType>(opt: ExecutarRequestParams) {
|
||||
return this.executarRequest<ResponseType>({
|
||||
method: "POST",
|
||||
path,
|
||||
data,
|
||||
params,
|
||||
contentType,
|
||||
contentType: opt.contentType || ContentType.APPLICATION_JSON,
|
||||
...opt,
|
||||
});
|
||||
}
|
||||
|
||||
async delete<ResponseType>({ path, params, contentType = ContentType.APPLICATION_JSON }: ExecutarRequestParams) {
|
||||
async delete<ResponseType>(opt: ExecutarRequestParams) {
|
||||
return this.executarRequest<ResponseType>({
|
||||
method: "DELETE",
|
||||
path,
|
||||
params,
|
||||
contentType,
|
||||
contentType: opt.contentType || ContentType.APPLICATION_JSON,
|
||||
...opt,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue