Junaidb commited on
Commit
b7f11de
·
verified ·
1 Parent(s): 702e743

Create updatedynamicendpoint.py

Browse files
Files changed (1) hide show
  1. components/updatedynamicendpoint.py +24 -0
components/updatedynamicendpoint.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from components.mongodbconnection import provideClient
2
+
3
+ mc=provideClient()
4
+
5
+ db=mc["x402ify_db"]
6
+ coll=db["x402ify_col"]
7
+
8
+ def UpdateDynamicEndpoint(owner,tag,newendpoint):
9
+
10
+ try:
11
+
12
+
13
+ coll.find_one_and_update(
14
+ {"owner": owner},
15
+ { "$set": {"dynamicendpoints.$[elem].endpoint": newendpoint}
16
+ },
17
+ array_filters=[{"elem.endpoint_linker": tag}],
18
+
19
+ )
20
+
21
+ return {"status":True}
22
+ except Exception as e:
23
+ return {"status":False}
24
+