-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Feature: Puzzle Revoke | ||
Scenario: PUT /event/puzzle/revoke to revoke attendee puzzle | ||
Given there have some attendees | ||
| token | event_id | display_name | | ||
| f185f505-d8c0-43ce-9e7b-bb9e8909072d | SITCON | Aotoki | | ||
When I make a PUT request to "/event/puzzle/revoke?token=f185f505-d8c0-43ce-9e7b-bb9e8909072d": | ||
""" | ||
{} | ||
""" | ||
Then the response json should be: | ||
""" | ||
{ | ||
"status": "OK" | ||
} | ||
""" | ||
And the response status should be 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { IRequest } from 'itty-router' | ||
import { OpenAPIRoute, OpenAPIRouteSchema } from '@cloudflare/itty-router-openapi' | ||
import { Put } from '@worker/router' | ||
import { json } from '@worker/utils' | ||
import * as schema from '@api/schema' | ||
|
||
export type RevokePuzzleRequest = IRequest | ||
|
||
@Put('/event/puzzle/revoke') | ||
export class RevokePuzzle extends OpenAPIRoute { | ||
static schema: OpenAPIRouteSchema = { | ||
summary: "Revoke attendee's puzzle", | ||
tags: ['Puzzle'], | ||
requestBody: {}, | ||
parameters: { | ||
token: schema.OptionalAttendeeTokenQuery, | ||
}, | ||
responses: { | ||
'200': { | ||
description: 'Result of puzzle revocation', | ||
schema: schema.puzzleRevokeResponseSchema, | ||
}, | ||
}, | ||
} | ||
|
||
async handle(_request: RevokePuzzleRequest, _env: unknown, _context: unknown) { | ||
return json({ status: 'OK' }) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters