fix: remove undici fetch function
This commit is contained in:
@@ -6,6 +6,6 @@
|
|||||||
"baseUrl": "http://localhost:3000"
|
"baseUrl": "http://localhost:3000"
|
||||||
},
|
},
|
||||||
"prod": {
|
"prod": {
|
||||||
"baseUrl": "http://localhost:3000"
|
"baseUrl": "https://api-dev.healahealth.app/v1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export class OpenRouterService implements OnModuleDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async createOpenRouter() {
|
private async createOpenRouter() {
|
||||||
const { ProxyAgent, fetch: undiciFetch } = await import('undici');
|
const { ProxyAgent } = await import('undici');
|
||||||
const { HTTPClient, OpenRouter } = await import('@openrouter/sdk');
|
const { HTTPClient, OpenRouter } = await import('@openrouter/sdk');
|
||||||
|
|
||||||
const env = this.configService.get<string>('app.environment');
|
const env = this.configService.get<string>('app.environment');
|
||||||
@@ -58,17 +58,14 @@ export class OpenRouterService implements OnModuleDestroy {
|
|||||||
try {
|
try {
|
||||||
const httpClient = new HTTPClient({
|
const httpClient = new HTTPClient({
|
||||||
fetcher: async (input, init) => {
|
fetcher: async (input, init) => {
|
||||||
const response = await undiciFetch(
|
const response = await globalThis.fetch(input, {
|
||||||
input as string | URL,
|
|
||||||
{
|
|
||||||
...init,
|
...init,
|
||||||
dispatcher: proxyAgent,
|
dispatcher: proxyAgent,
|
||||||
} as Parameters<typeof undiciFetch>[1] & {
|
} as RequestInit & {
|
||||||
dispatcher: typeof proxyAgent;
|
dispatcher: typeof proxyAgent;
|
||||||
},
|
});
|
||||||
);
|
|
||||||
|
|
||||||
return response as unknown as Response;
|
return response;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ Content-Type: application/json
|
|||||||
lang: fa
|
lang: fa
|
||||||
|
|
||||||
{
|
{
|
||||||
"phone": "09333026363",
|
"phone": "09121212123",
|
||||||
"password": "Password1@"
|
"password": "Password1@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ POST {{baseUrl}}/auth/verify-otp
|
|||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"phone": "09333026363",
|
"phone": "09121212123",
|
||||||
"otp": "50226"
|
"otp": "71288"
|
||||||
}
|
}
|
||||||
|
|
||||||
{{
|
{{
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ Authorization: Bearer {{$global.accessToken}}
|
|||||||
lang: fa
|
lang: fa
|
||||||
|
|
||||||
{
|
{
|
||||||
"firstName": "رادمهر",
|
"firstName": "تست",
|
||||||
"lastName": "ترناس",
|
"lastName": "تستعلی",
|
||||||
"password": "Password1@",
|
"password": "Password1@",
|
||||||
"confirmPassword": "Password1@"
|
"confirmPassword": "Password1@"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user