diff --git a/frontend/components/projects/edit/organisations/index.tsx b/frontend/components/projects/edit/organisations/index.tsx index 91ab12746..4002ebca8 100644 --- a/frontend/components/projects/edit/organisations/index.tsx +++ b/frontend/components/projects/edit/organisations/index.tsx @@ -34,6 +34,7 @@ import useProjectContext from '../useProjectContext' import useParticipatingOrganisations from './useParticipatingOrganisations' import {cfgOrganisations as config} from './config' import ProjectCategoriesDialog from './ProjectCategoriesDialog' +import {removeOrganisationCategoriesFromProject} from './apiProjectOrganisations' export default function ProjectOrganisations() { const {token,user} = useSession() @@ -190,6 +191,9 @@ export default function ProjectOrganisations() { const organisation = organisations[pos] // if it has id if (organisation?.id) { + // remove categories from project - do not wait for result + removeOrganisationCategoriesFromProject(project.id,organisation.id,token) + // remove organisation from project const resp = await deleteOrganisationFromProject({ project: project.id, organisation: organisation.id, diff --git a/frontend/components/software/edit/organisations/index.tsx b/frontend/components/software/edit/organisations/index.tsx index 7ce5db665..6d35f93e2 100644 --- a/frontend/components/software/edit/organisations/index.tsx +++ b/frontend/components/software/edit/organisations/index.tsx @@ -40,6 +40,7 @@ import { deleteOrganisationFromSoftware, patchOrganisationPositions } from './organisationForSoftware' import SoftwareCategoriesDialog from './SoftwareCategoriesDialog' +import {removeOrganisationCategoriesFromSoftware} from './apiSoftwareOrganisations' export type OrganisationModalStates = ModalStates & { categories: T @@ -211,9 +212,12 @@ export default function SoftwareOrganisations() { // get organisation const organisation = organisations[pos] // if it has id - if (organisation?.id) { + if (organisation?.id && software?.id) { + // remove categories from software - do not wait for result + removeOrganisationCategoriesFromSoftware(software?.id, organisation.id, token) + // remove organisation from software const resp = await deleteOrganisationFromSoftware({ - software: software?.id ?? undefined, + software: software?.id, organisation: organisation.id, token })