import { IServerResponse } from '@/types/common.types'; import { API_BASE_URL } from '@/shared/constants'; import apiClient from '@api/api-client'; import { ITaskLabel } from '@/types/tasks/taskLabel.types'; const rootUrl = `${API_BASE_URL}/labels`; export const labelsApiService = { getLabels: async (): Promise> => { const response = await apiClient.get>(`${rootUrl}`); return response.data; }, getPriorityByTask: async (taskId: string): Promise> => { const response = await apiClient.get>( `${rootUrl}/tasks/${taskId}` ); return response.data; }, getPriorityByProject: async (projectId: string): Promise> => { const response = await apiClient.get>( `${rootUrl}/project/${projectId}` ); return response.data; }, updateColor: async (labelId: string, color: string): Promise> => { const response = await apiClient.put>( `${rootUrl}/tasks/${labelId}/color`, { color } ); return response.data; }, deleteById: async (labelId: string): Promise> => { const response = await apiClient.delete>(`${rootUrl}/team/${labelId}`); return response.data; }, };