mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-15 01:41:56 +00:00
I'm not sure if this is an ideal fix for this, but it seems to work for me. If you have another idea just let me know. Closes #1798 Closes #1773
19 lines
406 B
TypeScript
19 lines
406 B
TypeScript
import WoodpeckerClient from '~/lib/api';
|
|
|
|
import useConfig from './useConfig';
|
|
|
|
let apiClient: WoodpeckerClient | undefined;
|
|
|
|
export default (): WoodpeckerClient => {
|
|
if (!apiClient) {
|
|
const config = useConfig();
|
|
const server = config.rootPath;
|
|
const token = null;
|
|
const csrf = config.csrf || null;
|
|
|
|
apiClient = new WoodpeckerClient(server, token, csrf);
|
|
}
|
|
|
|
return apiClient;
|
|
};
|