Skip to content

Commit

Permalink
Removes delete endpoint and related service function
Browse files Browse the repository at this point in the history
  • Loading branch information
mvilanova committed Nov 13, 2024
1 parent 8ced93f commit 7fe8492
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
8 changes: 0 additions & 8 deletions src/dispatch/signal/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,14 +536,6 @@ def update(*, db_session: Session, signal: Signal, signal_in: SignalUpdate) -> S
return signal


def delete(*, db_session: Session, signal_id: int):
"""Deletes a signal definition."""
signal = db_session.query(Signal).filter(Signal.id == signal_id).one()
db_session.delete(signal)
db_session.commit()
return signal_id


def is_valid_uuid(val):
try:
uuid.UUID(str(val), version=4)
Expand Down
17 changes: 0 additions & 17 deletions src/dispatch/signal/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
create,
create_signal_engagement,
create_signal_filter,
delete,
delete_signal_filter,
get,
get_by_primary_or_external_id,
Expand Down Expand Up @@ -330,19 +329,3 @@ def update_signal(
) from None

return signal


@router.delete(
"/{signal_id}",
response_model=None,
dependencies=[Depends(PermissionsDependency([SensitiveProjectActionPermission]))],
)
def delete_signal(db_session: DbSession, signal_id: Union[str, PrimaryKey]):
"""Deletes a signal."""
signal = get_by_primary_or_external_id(db_session=db_session, signal_id=signal_id)
if not signal:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=[{"msg": "A signal with this id does not exist."}],
)
delete(db_session=db_session, signal_id=signal.id)

0 comments on commit 7fe8492

Please sign in to comment.