Migrate git api to ts

This commit is contained in:
2025-05-06 21:02:09 +02:00
parent 02c8100f0b
commit 1e350bb0cf
14 changed files with 61 additions and 41 deletions

View File

@@ -1,5 +1,5 @@
import { useState, useCallback, useEffect } from 'react';
import { fetchFileContent } from '../api/notes';
import { fetchFileContent } from '../api/git';
import { isImageFile } from '../utils/fileHelpers';
import { DEFAULT_FILE } from '../utils/constants';
import { useWorkspace } from '../contexts/WorkspaceContext';

View File

@@ -1,5 +1,5 @@
import { useState, useCallback } from 'react';
import { fetchFileList } from '../api/notes';
import { fetchFileList } from '../api/git';
import { useWorkspace } from '../contexts/WorkspaceContext';
export const useFileList = () => {

View File

@@ -1,6 +1,6 @@
import { useCallback } from 'react';
import { notifications } from '@mantine/notifications';
import { saveFileContent, deleteFile } from '../api/notes';
import { saveFileContent, deleteFile } from '../api/git';
import { useWorkspace } from '../contexts/WorkspaceContext';
import { useGitOperations } from './useGitOperations';

View File

@@ -1,6 +1,6 @@
import { useCallback } from 'react';
import { notifications } from '@mantine/notifications';
import { pullChanges, commitAndPush } from '../api/notes';
import { pullChanges, commitAndPush } from '../api/git';
import { useWorkspace } from '../contexts/WorkspaceContext';
export const useGitOperations = () => {

View File

@@ -1,5 +1,5 @@
import { useCallback } from 'react';
import { getLastOpenedFile, updateLastOpenedFile } from '../api/notes';
import { getLastOpenedFile, updateLastOpenedFile } from '../api/git';
import { useWorkspace } from '../contexts/WorkspaceContext';
export const useLastOpenedFile = () => {

View File

@@ -1,6 +1,6 @@
import { useState, useCallback } from 'react';
import { notifications } from '@mantine/notifications';
import { updateProfile, deleteProfile } from '../api/notes';
import { updateProfile, deleteProfile } from '../api/git';
export function useProfileSettings() {
const [loading, setLoading] = useState(false);