Junaidb commited on
Commit
fdedf13
·
verified ·
1 Parent(s): 031c834

Create dynamicendpointscheck.py

Browse files
Files changed (1) hide show
  1. components/dynamicendpointscheck.py +21 -0
components/dynamicendpointscheck.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from components.mongodbconnection import provideClient
2
+
3
+ mc=provideClient()
4
+
5
+ db=mc["x402ify_db"]
6
+ coll=db["x402ify_col"]
7
+
8
+
9
+ def checkDynamicEndpoints(owner):
10
+ document=coll.find_one({"owner":owner})
11
+
12
+ if document:
13
+ endpoints=document["dynamicendpoints"]
14
+ if len(endpoints) == 0:
15
+
16
+ return {"status":False,"dynamicendpoints":[]}
17
+
18
+ else:
19
+ return {"status":True,"dynamicendpoints":endpoints}
20
+ else:
21
+ return {"status":False,"dynamicendpoints":endpoints}