|
|
@@ -77,8 +77,8 @@ export const salaryListTool = async (args: SalaryListInput) => {
|
|
|
take: take.toString()
|
|
|
};
|
|
|
|
|
|
- // Custom route uses getAllSalaries endpoint
|
|
|
- const response = await apiClient.get<{ data: SalaryLevel[]; total: number }>('/api/v1/salary/getAllSalaries', params);
|
|
|
+ // Custom route uses list endpoint
|
|
|
+ const response = await apiClient.get<{ data: SalaryLevel[]; total: number }>('/api/v1/salary/list', params);
|
|
|
|
|
|
const salaries = response.data || [];
|
|
|
const total = response.total || 0;
|
|
|
@@ -182,7 +182,7 @@ export const salaryCreateTool = async (args: SalaryCreateInput) => {
|
|
|
const apiClient = getApiClient();
|
|
|
|
|
|
try {
|
|
|
- const response = await apiClient.post<SalaryLevel>('/api/v1/salary/createSalary', args);
|
|
|
+ const response = await apiClient.post<SalaryLevel>('/api/v1/salary/create', args);
|
|
|
|
|
|
const salary = response;
|
|
|
|
|
|
@@ -223,7 +223,7 @@ export const salaryUpdateTool = async (args: SalaryUpdateInput) => {
|
|
|
|
|
|
try {
|
|
|
const { id, ...updateData } = args;
|
|
|
- const response = await apiClient.post<SalaryLevel>('/api/v1/salary/updateSalary', { id, ...updateData });
|
|
|
+ const response = await apiClient.put<SalaryLevel>(`/api/v1/salary/update/${id}`, updateData);
|
|
|
|
|
|
const salary = response;
|
|
|
|
|
|
@@ -264,7 +264,7 @@ export const salaryDeleteTool = async (args: SalaryDeleteInput) => {
|
|
|
|
|
|
try {
|
|
|
const { id } = args;
|
|
|
- await apiClient.post<{ success: boolean }>('/api/v1/salary/deleteSalary', { id });
|
|
|
+ await apiClient.delete<{ success: boolean }>(`/api/v1/salary/delete/${id}`);
|
|
|
|
|
|
const markdown = `✅ **Salary Level Deleted Successfully**\n\nSalary Level ID ${id} has been deleted.`;
|
|
|
|