Skip to content

Commit

Permalink
remove user id and email from testing
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondhtet committed Sep 18, 2024
1 parent 3a2a420 commit 00f4f07
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions service/ConnectionService.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
export default async function api<T>({
url,
body,
method = 'GET',
userId,
userEmail
method = 'GET'
}: {
url: string,
body?: string,
method?: string,
userId?: string,
userEmail?: string
method?: string
}): Promise<T> {
console.log('url:', url, ' and method:', method);

let headers: HeadersInit | undefined = {};

if(process.env.NODE_ENV === 'development' && process.env.NEXT_PUBLIC_USERID && process.env.NEXT_PUBLIC_USERID.trim().length > 1){
userId=process.env.NEXT_PUBLIC_USERID;
headers['x-user-id'] = process.env.NEXT_PUBLIC_USERID;
}
if(process.env.NODE_ENV === 'development' && process.env.NEXT_PUBLIC_USEREMAIL && process.env.NEXT_PUBLIC_USEREMAIL.trim().length > 1){
userEmail=process.env.NEXT_PUBLIC_USEREMAIL;
}

if (userId && userId.trim().length > 1) {
headers['x-user-id'] = userId;
}

if (userEmail && userEmail.trim().length > 1) {
headers['x-user-email'] = userEmail;
headers['x-user-email'] = process.env.NEXT_PUBLIC_USEREMAIL;
}

return await fetch(url, {
Expand Down

0 comments on commit 00f4f07

Please sign in to comment.