mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor: sdk init (#9563)
This commit is contained in:
parent
975f2351ec
commit
136bb69bd0
9 changed files with 40 additions and 19 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { defaults, getMyUserInfo, isHttpError } from '@immich/sdk';
|
||||
import { getMyUserInfo, init, isHttpError } from '@immich/sdk';
|
||||
import { glob } from 'fast-glob';
|
||||
import { createHash } from 'node:crypto';
|
||||
import { createReadStream } from 'node:fs';
|
||||
|
|
@ -46,8 +46,7 @@ export const connect = async (url: string, key: string) => {
|
|||
// noop
|
||||
}
|
||||
|
||||
defaults.baseUrl = url;
|
||||
defaults.headers = { 'x-api-key': key };
|
||||
init({ baseUrl: url, apiKey: key });
|
||||
|
||||
const [error] = await withError(getMyUserInfo());
|
||||
if (isHttpError(error)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue