Skip to content

Commit

Permalink
feat(clock): Update the clock using a HTTP POST
Browse files Browse the repository at this point in the history
  • Loading branch information
barnslig committed Jul 20, 2021
1 parent d75d9fa commit 660ed2f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/src/common/hooks/api/useUpdateClock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const useUpdateClock = (): [
const updateClock = async (state: ClockState) => {
try {
const res = await callApi({
method: "PATCH",
method: "POST",
body: JSON.stringify({
data: {
type: "clock",
Expand Down
2 changes: 1 addition & 1 deletion app/src/mocks/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const handlers = [
clockRes.data.attributes.state = clockState;
return res(ctx.json(clockRes));
}),
rest.patch("/games/:gameId/clock", (req, res, ctx) => {
rest.post("/games/:gameId/clock", (req, res, ctx) => {
clockState =
JSON.parse(req.body as string).data.attributes.state || "running";

Expand Down
4 changes: 2 additions & 2 deletions docs/ABC-DPT.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ paths:
speed: 1
operationId: get-clock
description: Get the current server game clock state.
patch:
post:
summary: Update game clock state
operationId: patch-clock
operationId: post-clock
responses:
"200":
description: OK
Expand Down

0 comments on commit 660ed2f

Please sign in to comment.