Closed carlbrugger closed 5 months ago
The recent changes to the FlatfileClient.ts
file focus on improving import order and enhancing environment handling. The imports of CrossEnvConfig
and urlJoin
were reordered, and the import of environments
was moved below core
. Additionally, the constructor was updated to utilize a new resolveEnvironment
function, which ensures that the environment is correctly set based on the provided options. This change addresses the issue of the Flatfile Client not appending /v1
to the URL.
File Path | Change Summary |
---|---|
src/wrapper/FlatfileClient.ts |
Reordered imports, moved environments import, updated constructor, added resolveEnvironment function |
sequenceDiagram
participant User
participant FlatfileClient
participant API
User->>FlatfileClient: Initialize with environment URL
FlatfileClient->>FlatfileClient: resolveEnvironment(options)
FlatfileClient->>API: Append /v1 to URL and make request
API-->>FlatfileClient: Respond to request
FlatfileClient-->>User: Return response
Objective (Issue #) | Addressed | Explanation |
---|---|---|
Ensure Flatfile Client appends /v1 to the end of the URL (#1339) |
✅ |
src/wrapper/FlatfileClient.ts
[error] 35-35: The assignment should not be in an expression. --- [error] 56-56: Use === instead of ==. == is only allowed when comparing against `null` --- [error] 3-4: All these imports are only used as types.
src/wrapper/FlatfileClient.ts (1)
`27-27`: Constructor now correctly uses `resolveEnvironment` to set the environment.
Closes https://github.com/FlatFilers/support-triage/issues/1339