feat(labels): implement label update functionality and enhance UI
- Added `updateLabel` method in `LabelsController` to handle label updates with validation for name and color. - Updated API routes to include the new label update endpoint. - Introduced `LabelsDrawer` component for editing labels, including a color picker and form validation. - Enhanced localization files to support new UI strings for label management. - Implemented a new `LabelsSettings` page to manage labels with search and edit capabilities. - Improved color handling with a comprehensive color palette for better user experience.
This commit is contained in:
@@ -27,12 +27,17 @@ export const labelsApiService = {
|
||||
|
||||
updateColor: async (labelId: string, color: string): Promise<IServerResponse<ITaskLabel>> => {
|
||||
const response = await apiClient.put<IServerResponse<ITaskLabel>>(
|
||||
`${rootUrl}/tasks/${labelId}/color`,
|
||||
`${rootUrl}/tasks/${labelId}`,
|
||||
{ color }
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
updateLabel: async (labelId: string, data: { name?: string; color?: string }): Promise<IServerResponse<ITaskLabel>> => {
|
||||
const response = await apiClient.put<IServerResponse<ITaskLabel>>(`${rootUrl}/team/${labelId}`, data);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
deleteById: async (labelId: string): Promise<IServerResponse<void>> => {
|
||||
const response = await apiClient.delete<IServerResponse<void>>(`${rootUrl}/team/${labelId}`);
|
||||
return response.data;
|
||||
|
||||
Reference in New Issue
Block a user