Skip to content

Commit

Permalink
Merge pull request #55 from FlatFilers/fix/api-url
Browse files Browse the repository at this point in the history
Fix/api url
  • Loading branch information
bangarang authored Oct 2, 2024
2 parents dc9c7f8 + aa6a6f4 commit 00f8707
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
"prettier": "2.7.1",
"typescript": "4.6.4"
}
}
}
4 changes: 2 additions & 2 deletions src/wrapper/FlatfileClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class FlatfileClient extends FernClient {

constructor(options: FlatfileClient.Options = {}) {
super({
environment: resolveEnvironment(options),
environment: resolveEnvironment(options) ?? environmentSupplier,
token: options.token ?? tokenSupplier,
});
}
Expand All @@ -40,7 +40,7 @@ const resolveEnvironment = (options: FlatfileClient.Options) => {
if (options.apiUrl && !options.apiUrl.endsWith("/v1")) {
return urlJoin(options.apiUrl, "v1");
}
return options.environment || options.apiUrl || environmentSupplier();
return options.environment || options.apiUrl;
};

const environmentSupplier = () => {
Expand Down

0 comments on commit 00f8707

Please sign in to comment.