split: sync-client services layer
Add build-vault-url helper. Rewrite fetch-controller and websocket-manager (plus their tests). Update server-config and sync-service to consume the new error types and the regenerated API types from previous chunks.
This commit is contained in:
parent
9d99a4ac23
commit
45b86cffe4
7 changed files with 377 additions and 232 deletions
8
frontend/sync-client/src/services/build-vault-url.ts
Normal file
8
frontend/sync-client/src/services/build-vault-url.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import type { Settings } from "../persistence/settings";
|
||||
|
||||
export function buildVaultUrl(settings: Settings, path: string): string {
|
||||
const { vaultName, remoteUri } = settings.getSettings();
|
||||
const remoteUriWithoutTrailingSlash = remoteUri.replace(/\/+$/, "");
|
||||
const encodedVaultName = encodeURIComponent(vaultName.trim());
|
||||
return `${remoteUriWithoutTrailingSlash}/vaults/${encodedVaultName}${path}`;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue