Skip to content

Commit

Permalink
Fix prettier checks
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhtranduy committed Jul 24, 2024
1 parent f513fdf commit bb86d4b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions backoffice/common/services/ApiClientService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ interface RequestOptions {
body?: string;
}

const sendRequest = async (method: string, endpoint: string, data: any = null, contentType: string | null = null) => {
const sendRequest = async (
method: string,
endpoint: string,
data: any = null,
contentType: string | null = null
) => {
const defaultContentType = 'application/json; charset=UTF-8';
const requestOptions: RequestOptions = {
method: method.toUpperCase(),
Expand Down Expand Up @@ -39,8 +44,10 @@ const sendRequest = async (method: string, endpoint: string, data: any = null, c

const apiClientService = {
get: (endpoint: string) => sendRequest('GET', endpoint),
post: (endpoint: string, data: any, contentType: any | null = null) => sendRequest('POST', endpoint, data, contentType),
put: (endpoint: string, data: any, contentType: any | null = null) => sendRequest('PUT', endpoint, data, contentType),
post: (endpoint: string, data: any, contentType: any | null = null) =>
sendRequest('POST', endpoint, data, contentType),
put: (endpoint: string, data: any, contentType: any | null = null) =>
sendRequest('PUT', endpoint, data, contentType),
delete: (endpoint: string) => sendRequest('DELETE', endpoint),
};

Expand Down

0 comments on commit bb86d4b

Please sign in to comment.