e434c439c9
- Rename all component files to PascalCase matching exported names - Move components into feature directories (git/, session/, project/, terminal/, workspace/, ui/, layout/) - Rename all page files to PascalCase with Page suffix - Rename all API files to kebab-case - Update all imports across codebase with corrected relative depths - Preserve git history via git mv Quality gates: tsc (pass), eslint (pass), 66/74 tests pass (8 pre-existing failures) Refs: repo-restructure Task 4.4
78 lines
1.9 KiB
TypeScript
78 lines
1.9 KiB
TypeScript
import { apiClient } from "./client";
|
|
import type {
|
|
ConfigFolder,
|
|
CreateConfigFolderRequest,
|
|
UpdateConfigFolderRequest,
|
|
ProjectOverrideRequest,
|
|
} from "../types/config-folder";
|
|
|
|
export type {
|
|
ConfigFolder,
|
|
CreateConfigFolderRequest,
|
|
UpdateConfigFolderRequest,
|
|
ProjectOverrideRequest,
|
|
} from "../types/config-folder";
|
|
|
|
export const listConfigFolders = async (): Promise<ConfigFolder[]> => {
|
|
const response = await apiClient.get<ConfigFolder[]>("/config-folders");
|
|
return response.data;
|
|
};
|
|
|
|
export const getConfigFolder = async (id: string): Promise<ConfigFolder> => {
|
|
const response = await apiClient.get<ConfigFolder>(`/config-folders/${id}`);
|
|
return response.data;
|
|
};
|
|
|
|
export const createConfigFolder = async (
|
|
data: CreateConfigFolderRequest,
|
|
): Promise<ConfigFolder> => {
|
|
const response = await apiClient.post<ConfigFolder>("/config-folders", data);
|
|
return response.data;
|
|
};
|
|
|
|
export const updateConfigFolder = async (
|
|
id: string,
|
|
data: UpdateConfigFolderRequest,
|
|
): Promise<ConfigFolder> => {
|
|
const response = await apiClient.put<ConfigFolder>(
|
|
`/config-folders/${id}`,
|
|
data,
|
|
);
|
|
return response.data;
|
|
};
|
|
|
|
export const deleteConfigFolder = async (id: string): Promise<void> => {
|
|
await apiClient.delete(`/config-folders/${id}`);
|
|
};
|
|
|
|
export const addProjectOverride = async (
|
|
id: string,
|
|
projectId: string,
|
|
data: ProjectOverrideRequest,
|
|
): Promise<ConfigFolder> => {
|
|
const response = await apiClient.post<ConfigFolder>(
|
|
`/config-folders/${id}/overrides/${projectId}`,
|
|
data,
|
|
);
|
|
return response.data;
|
|
};
|
|
|
|
export const updateProjectOverride = async (
|
|
id: string,
|
|
projectId: string,
|
|
data: ProjectOverrideRequest,
|
|
): Promise<ConfigFolder> => {
|
|
const response = await apiClient.put<ConfigFolder>(
|
|
`/config-folders/${id}/overrides/${projectId}`,
|
|
data,
|
|
);
|
|
return response.data;
|
|
};
|
|
|
|
export const deleteProjectOverride = async (
|
|
id: string,
|
|
projectId: string,
|
|
): Promise<void> => {
|
|
await apiClient.delete(`/config-folders/${id}/overrides/${projectId}`);
|
|
};
|