feat: delete habits from detail sheet
This commit is contained in:
@@ -630,6 +630,14 @@ async def archive_habit(habit_id: UUID, user: User = Depends(current_user), db:
|
||||
row = await owned_habit(db, user.id, habit_id); row.archived_at = utcnow(); await db.commit(); return Response(status_code=204)
|
||||
|
||||
|
||||
@router.delete("/habits/{habit_id}/permanent", status_code=204)
|
||||
async def delete_habit_permanently(habit_id: UUID, user: User = Depends(current_user), db: AsyncSession = Depends(get_db)):
|
||||
row = await owned_habit(db, user.id, habit_id)
|
||||
await db.delete(row)
|
||||
await db.commit()
|
||||
return Response(status_code=204)
|
||||
|
||||
|
||||
@router.post("/habits/{habit_id}/logs")
|
||||
async def add_habit_log(habit_id: UUID, payload: HabitLogInput, user: User = Depends(current_user), db: AsyncSession = Depends(get_db)):
|
||||
habit = await owned_habit(db, user.id, habit_id)
|
||||
|
||||
Reference in New Issue
Block a user