Skip to content

Commit

Permalink
Merge branch 'main' of github.com:valmi-io/valmi-app-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
rajvarkala committed Jan 4, 2024
2 parents d5e6bf4 + f2deb06 commit f4fbfe8
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion core/stream_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,25 @@ def delete_obj(request, workspace_id, type, id):
except Exception as e:
raise e

return response.text
return response.text


@router.delete("/workspaces/{workspace_id}/config/{type}", response={200: Json, 500: Json})
def delete_link_obj(request, workspace_id, type, fromId, toId):
authObject = ValmiUserIDJitsuApiToken.objects.get(user=request.user)
response = requests.delete(
f"{config('STREAM_API_URL')}/api/{workspace_id}/config/{type}"
f"?workspaceId={workspace_id}&fromId={fromId}&toId={toId}",
timeout=SHORT_TIMEOUT,
headers=get_bearer_header(authObject.api_token),
)

try:
response.raise_for_status()
except requests.exceptions.HTTPError:
try:
return (500, response.text)
except Exception as e:
raise e

return response.text

0 comments on commit f4fbfe8

Please sign in to comment.