|
@@ -88,3 +88,17 @@ export const sendGuess = async (gameId, playerId, round, point) => {
|
|
}
|
|
}
|
|
return await res.json();
|
|
return await res.json();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+export const checkScore = async (point1, point2) => {
|
|
|
|
+ const res = await fetch(`${API_BASE}/score`, {
|
|
|
|
+ method: "POST",
|
|
|
|
+ headers: {
|
|
|
|
+ "Content-Type": "application/json",
|
|
|
|
+ },
|
|
|
|
+ body: JSON.stringify({ point1, point2 }),
|
|
|
|
+ });
|
|
|
|
+ if (!res.ok) {
|
|
|
|
+ throw Error(res.statusText);
|
|
|
|
+ }
|
|
|
|
+ return await res.json();
|
|
|
|
+}
|