refactor: seperated cloning from settings

This commit is contained in:
Sam Chau
2024-09-03 22:21:32 +09:30
parent fa4818cb6a
commit 92b38db7a9
8 changed files with 134 additions and 150 deletions

View File

@@ -110,16 +110,6 @@ export const getSettings = async () => {
}
};
export const saveSettings = async (settings) => {
try {
const response = await axios.post(`${API_BASE_URL}/settings`, settings);
return response.data;
} catch (error) {
console.error('Error saving settings:', error);
throw error;
}
};
export const getGitStatus = async () => {
try {
const response = await axios.get(`${API_BASE_URL}/git/status`);
@@ -247,6 +237,16 @@ export const getDiff = async (filePath) => {
}
};
export const cloneRepo = async (gitRepo, gitToken) => {
try {
const response = await axios.post(`${API_BASE_URL}/git/clone`, { gitRepo, gitToken });
return response.data;
} catch (error) {
console.error('Error cloning repository:', error);
throw error;
}
};
export const getProfiles = async () => {
try {
const response = await axios.get(`${API_BASE_URL}/profile`);