This commit is contained in:
vladislav 2026-09-02 00:13:15 -04:00
parent cacaf9fb64
commit 9b85b270e3
Signed by: Vladislav
GPG Key ID: D97C9E5E4860EE45
2 changed files with 12 additions and 0 deletions

View File

@ -3277,6 +3277,12 @@
" new_doc = {**existing, **update_data, \"notify\": notify.upserted_id}\n",
"\n",
" result = await delivery_collection.insert_one(new_doc)\n",
" else:\n",
" doc = await posts_collection.update_one({'$or': fin}, {'$set': {\"status\": \"В каталоге\"}})\n",
" await delivery_collection.delete_one(\n",
" {\"post_id\": post_id, \"status\": \"Продано\"}\n",
" )\n",
"\n",
" return {'ok': True}"
],
"display_name": ".venv"

View File

@ -2443,6 +2443,12 @@ async def sale_painting(
new_doc = {**existing, **update_data, "notify": notify.upserted_id}
result = await delivery_collection.insert_one(new_doc)
else:
doc = await posts_collection.update_one({'$or': fin}, {'$set': {"status": "В каталоге"}})
await delivery_collection.delete_one(
{"post_id": post_id, "status": "Продано"}
)
return {'ok': True}
@app.put("/api/post/{post_id}", response_model=dict)