Delete endpoints do not fully support bodies. Queries used instead. Tests added. Resolves #20
This commit is contained in:
parent
e9b272811f
commit
c452c6c0d5
13 changed files with 114 additions and 57 deletions
|
|
@ -31,6 +31,7 @@ from src.database import db_dependency
|
|||
from src.user.dependencies import (
|
||||
user_model_body_dependency,
|
||||
user_model_claims_dependency,
|
||||
user_model_query_dependency,
|
||||
)
|
||||
from src.auth.dependencies import (
|
||||
super_admin_dependency,
|
||||
|
|
@ -38,7 +39,10 @@ from src.auth.dependencies import (
|
|||
org_model_root_claim_body_dependency,
|
||||
)
|
||||
|
||||
from src.organisation.dependencies import org_model_body_dependency
|
||||
from src.organisation.dependencies import (
|
||||
org_model_body_dependency,
|
||||
org_model_query_dependency,
|
||||
)
|
||||
from src.organisation.constants import ContactType
|
||||
from src.organisation.models import Organisation as Org
|
||||
from src.organisation.schemas import (
|
||||
|
|
@ -52,8 +56,6 @@ from src.organisation.schemas import (
|
|||
OrgGetOrgResponse,
|
||||
OrgPatchRootRequest,
|
||||
OrgGetGroupResponse,
|
||||
OrgDeleteUserRequest,
|
||||
OrgDeleteOrgRequest,
|
||||
OrgPostOrgResponse,
|
||||
OrgPatchQuestionnaireResponse,
|
||||
OrgPatchStatusResponse,
|
||||
|
|
@ -324,9 +326,8 @@ async def add_user_to_org(
|
|||
)
|
||||
async def delete_organisation_by_id(
|
||||
db: db_dependency,
|
||||
org_model: org_model_body_dependency,
|
||||
org_model: org_model_query_dependency,
|
||||
su: super_admin_dependency,
|
||||
request_model: OrgDeleteOrgRequest,
|
||||
):
|
||||
"""
|
||||
Removes an organisation from the hub.
|
||||
|
|
@ -411,9 +412,8 @@ async def get_org_groups(org_model: org_model_root_claim_query_dependency):
|
|||
)
|
||||
async def remove_user_from_org(
|
||||
db: db_dependency,
|
||||
org_model: org_model_root_claim_body_dependency,
|
||||
user_model: user_model_body_dependency,
|
||||
request_model: OrgDeleteUserRequest,
|
||||
org_model: org_model_root_claim_query_dependency,
|
||||
user_model: user_model_query_dependency,
|
||||
):
|
||||
"""
|
||||
Revokes a user's membership in an organisation.
|
||||
|
|
|
|||
|
|
@ -88,10 +88,6 @@ class OrgPostUserResponse(CustomBaseModel):
|
|||
users: list[str]
|
||||
|
||||
|
||||
class OrgDeleteUserRequest(OrgIDMixin, UserIDMixin):
|
||||
pass
|
||||
|
||||
|
||||
class OrgPatchRootRequest(OrgIDMixin, UserIDMixin):
|
||||
pass
|
||||
|
||||
|
|
@ -133,7 +129,3 @@ class OrgGetOrgResponse(CustomBaseModel):
|
|||
billing_contact: Optional[str] = None
|
||||
security_contact: Optional[str] = None
|
||||
intake_questionnaire: Optional[Questionnaire] = None
|
||||
|
||||
|
||||
class OrgDeleteOrgRequest(OrgIDMixin):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue