Move syncToCloud out of httpClient.ts

This commit is contained in:
Mattias Granlund 2024-04-11 15:53:31 +02:00
parent b7ca1ad2c4
commit 7aa30724e7
4 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,3 @@
import { invoke } from './ipc';
import { PUBLIC_API_BASE_URL } from '$env/static/public';
export const API_URL = new URL('/api/', PUBLIC_API_BASE_URL);
@ -103,11 +102,3 @@ async function parseResponseJSON(response: Response) {
return await response.json();
}
}
export async function syncToCloud(projectId: string | undefined) {
try {
if (projectId) await invoke<void>('project_flush_and_push', { id: projectId });
} catch (err: any) {
console.error(err);
}
}

View File

@ -0,0 +1,9 @@
import { invoke } from './ipc';
export async function syncToCloud(projectId: string | undefined) {
try {
if (projectId) await invoke<void>('project_flush_and_push', { id: projectId });
} catch (err: any) {
console.error(err);
}
}

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { syncToCloud } from '$lib/backend/httpClient';
import { Project } from '$lib/backend/projects';
import { syncToCloud } from '$lib/backend/sync';
import Tag from '$lib/components/Tag.svelte';
import TimeAgo from '$lib/components/TimeAgo.svelte';
import { GitHubService } from '$lib/github/service';

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { syncToCloud } from '$lib/backend/httpClient';
import { Project } from '$lib/backend/projects';
import { syncToCloud } from '$lib/backend/sync';
import { BranchService } from '$lib/branches/service';
import Navigation from '$lib/components/Navigation.svelte';
import NoBaseBranch from '$lib/components/NoBaseBranch.svelte';