added delete
Browse files
App/Transcription/TranscriptionRoutes.py
CHANGED
@@ -76,6 +76,16 @@ async def get_user_transcriptions(
|
|
76 |
return objects
|
77 |
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
@transcription_router.post("/uploadfile/")
|
80 |
async def create_file(
|
81 |
background_tasks: BackgroundTasks,
|
|
|
76 |
return objects
|
77 |
|
78 |
|
79 |
+
@transcription_router.post("/delete/{task_id}")
|
80 |
+
async def delete_transcription(
|
81 |
+
task_id: str,
|
82 |
+
user: UserSchema = Depends(get_token_owner),
|
83 |
+
):
|
84 |
+
transcript = await Transcriptions.objects.filter(task_id=task_id).first()
|
85 |
+
await transcript.delete()
|
86 |
+
return {"code": 200, "message": f"deleted {task_id}", "payload": None}
|
87 |
+
|
88 |
+
|
89 |
@transcription_router.post("/uploadfile/")
|
90 |
async def create_file(
|
91 |
background_tasks: BackgroundTasks,
|