Skip to content

Commit

Permalink
fix: Clarify the deliberate inconsistency in the API
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-hughes committed Feb 8, 2023
1 parent e82a88f commit 4ce3b52
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/activity_3.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

Here's the design for this page:

![Confess To Us](./images/confess.png "Sketched confession page")
![Confess To Us](./images/confess.png 'Sketched confession page')

Well, that's pretty surprising.

## Form Elements

It looks like they want a form with three elements.

- A subject line for the confession.
- A subject line for the confession.

- A dropdown for the reason for the confession. This could be either a type of misdemeanour, or "I just want to talk"
- A dropdown for the reason for the confession. This could be either a type of misdemeanour, or "I just want to talk"

- A text box for details
- A text box for details

## Form Behaviour - on the Client

Expand Down Expand Up @@ -77,6 +77,8 @@ You must POST the above form data to the endpoint:

2️⃣ If `success` is `true` and `justTalked` is `false`, i.e. it's a real confession, you should add the confession data to your list of misdemeanours so this new crime is visible on the misdemeanours page. (NB: the server does not save this data so if you hit F5 it will be lost. That's okay!)

🤔 You may notice that the returned data isn't _quite_ the same data type as the result from GETting misdemeanours. It's up to you how you handle this little inconsistency while meeting the requirements.

3️⃣ If `justTalked` is `true`, you don't have to do anything.

👉 Hold on! Have you been writing quality, valid, [accessible HTML](https://reactjs.org/docs/accessibility.html#semantic-html)? Maybe now is a good time to run your generated HTML through a validator and see! To do this, you can open your app in the browser and copy/paste the HTML from dev tools into a validator. 🙌
Expand Down

0 comments on commit 4ce3b52

Please sign in to comment.