@@ -68,17 +68,17 @@ async def insertPlayerRank(
6868 xquery = insertQuery (sql )
6969
7070 if xquery < 1 :
71- return JSONResponse (
72- status_code = status .HTTP_204_NO_CONTENT ,
73- content = {"inserted" : xquery , "xtime" : time .perf_counter () - tic },
74- )
71+ response .body = {"inserted" : xquery , "xtime" : time .perf_counter () - tic }
72+ response .status_code = status .HTTP_304_NOT_MODIFIED
73+ return response
7574
7675 # Prepare the response
7776 toc = time .perf_counter ()
7877 print (f"Execution time { toc - tic :0.4f} " )
7978
80- return {"inserted" : xquery , "xtime" : time .perf_counter () - tic }
81-
79+ response .body = {"inserted" : xquery , "xtime" : time .perf_counter () - tic }
80+ response .status_code = status .HTTP_201_CREATED
81+ return response
8282
8383@router .put (
8484 "surftimer/updatePlayerRankPoints" ,
@@ -116,17 +116,17 @@ async def updatePlayerRankPoints(
116116 xquery = insertQuery (sql )
117117
118118 if xquery < 1 :
119- return JSONResponse (
120- status_code = status .HTTP_204_NO_CONTENT ,
121- content = {"updated" : xquery , "xtime" : time .perf_counter () - tic },
122- )
119+ response .body = {"updated" : xquery , "xtime" : time .perf_counter () - tic }
120+ response .status_code = status .HTTP_304_NOT_MODIFIED
121+ return response
123122
124123 # Prepare the response
125124 toc = time .perf_counter ()
126125 print (f"Execution time { toc - tic :0.4f} " )
127126
128- return {"updated" : xquery , "xtime" : time .perf_counter () - tic }
129-
127+ response .body = {"updated" : xquery , "xtime" : time .perf_counter () - tic }
128+ response .status_code = status .HTTP_200_OK
129+ return response
130130
131131@router .put (
132132 "surftimer/updatePlayerRankPoints2" ,
@@ -167,17 +167,17 @@ async def updatePlayerRankPoints2(
167167 xquery = insertQuery (sql )
168168
169169 if xquery < 1 :
170- return JSONResponse (
171- status_code = status .HTTP_204_NO_CONTENT ,
172- content = {"updated" : xquery , "xtime" : time .perf_counter () - tic },
173- )
170+ response .body = {"updated" : xquery , "xtime" : time .perf_counter () - tic }
171+ response .status_code = status .HTTP_304_NOT_MODIFIED
172+ return response
174173
175174 # Prepare the response
176175 toc = time .perf_counter ()
177176 print (f"Execution time { toc - tic :0.4f} " )
178177
179- return {"updated" : xquery , "xtime" : time .perf_counter () - tic }
180-
178+ response .body = {"updated" : xquery , "xtime" : time .perf_counter () - tic }
179+ response .status_code = status .HTTP_200_OK
180+ return response
181181
182182@router .put (
183183 "surftimer/updatePlayerRank" ,
@@ -203,17 +203,17 @@ async def updatePlayerRank(
203203 xquery = insertQuery (sql )
204204
205205 if xquery < 1 :
206- return JSONResponse (
207- status_code = status .HTTP_204_NO_CONTENT ,
208- content = {"updated" : xquery , "xtime" : time .perf_counter () - tic },
209- )
206+ response .body = {"updated" : xquery , "xtime" : time .perf_counter () - tic }
207+ response .status_code = status .HTTP_304_NOT_MODIFIED
208+ return response
210209
211210 # Prepare the response
212211 toc = time .perf_counter ()
213212 print (f"Execution time { toc - tic :0.4f} " )
214213
215- return {"updated" : xquery , "xtime" : time .perf_counter () - tic }
216-
214+ response .body = {"updated" : xquery , "xtime" : time .perf_counter () - tic }
215+ response .status_code = status .HTTP_200_OK
216+ return response
217217
218218@router .get (
219219 "/surftimer/selectPlayerName" ,
@@ -272,17 +272,17 @@ async def updateLastSeen(
272272 xquery = insertQuery (sql )
273273
274274 if xquery < 1 :
275- return JSONResponse (
276- status_code = status .HTTP_204_NO_CONTENT ,
277- content = {"updated" : xquery , "xtime" : time .perf_counter () - tic },
278- )
275+ response .body = {"updated" : xquery , "xtime" : time .perf_counter () - tic }
276+ response .status_code = status .HTTP_304_NOT_MODIFIED
277+ return response
279278
280279 # Prepare the response
281280 toc = time .perf_counter ()
282281 print (f"Execution time { toc - tic :0.4f} " )
283282
284- return {"updated" : xquery , "xtime" : time .perf_counter () - tic }
285-
283+ response .body = {"updated" : xquery , "xtime" : time .perf_counter () - tic }
284+ response .status_code = status .HTTP_200_OK
285+ return response
286286
287287@router .get (
288288 "/surftimer/selectTopPlayers" ,
0 commit comments