-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PR] Stage 1 - No auth
, anonymous API for Timers
and Items
#263
Conversation
Codecov Report
@@ Coverage Diff @@
## main #263 +/- ##
===========================================
- Coverage 100.00% 99.73% -0.27%
===========================================
Files 12 14 +2
Lines 312 378 +66
===========================================
+ Hits 312 377 +65
- Misses 0 1 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Following @SimonLab's advice in #263 (comment), I previously had a Since I couldn't really use guards to check if However, I feel using Should I have? |
auth
anonymous API for Timers
and Items
auth
, anonymous API for Timers
and Items
https://github.com/dwyl/mvp/actions/runs/3906526566/jobs/6674798916#step:8:127 1) test timers update_timer(%{id: id, start: start, stop: stop}) with start later than stop
should throw error (App.TimerTest)
Error: test/app/timer_test.exs:100
** (KeyError) key :id not found in:
%{model: %App.Item{__meta__: #Ecto.Schema.Metadata<:loaded, "items">,
id: 4, person_id: 1, status: nil, text: "some text",
timer: #Ecto.Association.NotLoaded<association :timer is not loaded>,
tags: #Ecto.Association.NotLoaded<association :tags is not loaded>,
inserted_at: ~N[2023-01-12 22:24:06], updated_at: ~N[2023-01-12 22:24:06]},
version: %PaperTrail.Version{__meta__: #Ecto.Schema.Metadata<:loaded, "versions">, id: 4,
event: "insert", item_type: "Item", item_id: 4,
item_changes: %{id: 4, inserted_at: ~N[2023-01-12 22:24:06], person_id: 1,
status: nil, text: "some text", updated_at: ~N[2023-01-12 22:24:06]},
originator_id: 1, origin: nil, meta: nil, inserted_at:
~U[2023-01-12 22:24:06Z]}}
Warning: code: Timer.start(%{item_id: item.id, person_id: 1, start: seven_seconds_ago})
stacktrace:
test/app/timer_test.exs:111: (test) |
@LuchoTurtle tests failing due to me merging |
@LuchoTurtle https://github.com/martinthenth/goal looks decent. 👍 |
This should be done. |
@LuchoTurtle you've assigned to me but still |
@LuchoTurtle please open a |
The bug is in the implementation in this PR, I just need to make a couple of changes to it. No reason to merge this until I get it fixed 😅 |
Found it after assigning it for review, my fault on that. But it's if quick resolution, just assign it back to me when it's convenient for you |
Cool. I've done a review and made a few minor updates. 🧑💻 |
The merge should have fixed the problem. |
Just for clarification, I followed a "convention" that appeared on Stack Overflow -> https://stackoverflow.com/questions/42598281/where-to-put-phoenix-controllers-for-app-with-both-web-frontend-and-an-api But I do agree your change makes more sense 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LuchoTurtle Looks good. Thanks. 👍
Made a couple of notes in: #256 (comment) and opened a couple of new follow-up / side-quest issues: #269 & #268
Merging.
Testing the curl -X POST https://mvp-pr-263.fly.dev/api/items -H 'Content-Type: application/json' -d '{"text":"My Awesome item text"}' Response: {"id":1} Satisfied this is working. ✅ |
related to #256
This PR creates a first, basic, fully-tested version of a
RESTful
API for manipulating data anonymously withtimers
anditems
.Also creates a document to detail its development.