File tree 3 files changed +27
-6
lines changed
3 files changed +27
-6
lines changed Original file line number Diff line number Diff line change 4
4
"private" : true ,
5
5
"scripts" : {
6
6
"dev" : " vite" ,
7
- "build" : " run-p type-check \" build-only {@}\" --" ,
7
+ "build" : " run-p \" build-only {@}\" --" ,
8
8
"preview" : " vite preview" ,
9
9
"build-only" : " vite build" ,
10
10
"type-check" : " vue-tsc --noEmit -p tsconfig.app.json --composite false" ,
Original file line number Diff line number Diff line change 6
6
"X-Auth-Token" : TUBER_APIKEY
7
7
}
8
8
9
- attendees = uber_api .get_eligible_attendees ()
9
+ # attendees = uber_api.get_eligible_attendees()
10
10
11
- for attendee in attendees :
12
- request = requests .post (
13
- f'{ TUBER_URL } /api/uber_login' , json = {"token" : attendee })
14
- print (f"{ request .status_code } : { request .text .strip ()} " )
11
+ # for attendee in attendees:
12
+ # request = requests.post(
13
+ # f'{TUBER_URL}/api/uber_login', json={"token": attendee})
14
+ # print(f"{request.status_code}: {request.text.strip()}")
15
15
16
16
request = requests .post (
17
17
f"{ TUBER_URL } /api/uber_department_sync" , headers = headers )
Original file line number Diff line number Diff line change @@ -100,3 +100,24 @@ def get_nights():
100
100
newdate = newdate .strftime ("%Y-%m-%d" )
101
101
lookup [newdate ] = str (result ['order' ][idx ])
102
102
return lookup
103
+
104
+ def get_departments ():
105
+ req = {
106
+ "method" : "dept.list"
107
+ }
108
+ return requests .post (UBER_URL , headers = headers , json = req ).json ()['result' ]
109
+
110
+ def get_shifts ():
111
+ departments = get_departments ()
112
+ shifts = {}
113
+ for dept_id , dept_name in departments .items ():
114
+ print (f"Loading shifts from { dept_name } " )
115
+ req = {
116
+ "method" : "shifts.lookup" ,
117
+ "params" : {
118
+ "department_id" : dept_id
119
+ }
120
+ }
121
+ shifts [dept_id ] = requests .post (UBER_URL , headers = headers , json = req ).json ()['result' ]
122
+ print (f" Got { len (shifts [dept_id ])} shifts" )
123
+ return shifts
You can’t perform that action at this time.
0 commit comments