feat(company-skills): implement skill deletion with agent usage check

Added functionality to prevent deletion of skills that are still in use by agents. Updated the company skill service to throw an unprocessable error if a skill is attempted to be deleted while still referenced by agents. Enhanced the UI to include a delete button and confirmation dialog, displaying relevant messages based on agent usage. Updated tests to cover the new deletion logic and error handling.
This commit is contained in:
Daniel Sousa 2026-04-01 17:18:01 +01:00
parent 5b479652f2
commit 77f854c081
No known key found for this signature in database
4 changed files with 189 additions and 31 deletions

View file

@ -51,4 +51,8 @@ export const companySkillsApi = {
`/companies/${encodeURIComponent(companyId)}/skills/${encodeURIComponent(skillId)}/install-update`,
{},
),
delete: (companyId: string, skillId: string) =>
api.delete<CompanySkill>(
`/companies/${encodeURIComponent(companyId)}/skills/${encodeURIComponent(skillId)}`,
),
};