amazingmarvin / MarvinAPI

API documentation for the Amazing Marvin productivity tool
https://amazingmarvin.com/
94 stars 0 forks source link

[BUG] Creating a task with "done: true" doesn't create the task as done #54

Closed RogueArt closed 6 months ago

RogueArt commented 10 months ago

Statement of purpose

I do solemnly swear (or affirm) that this is an API bug, and not a Marvin bug. For Marvin bugs I would use the in-app "?→Contact Support" feature

Describe the bug Hope, you're having a good day! I noticed a small bug when creating a new task with { done: true } in the body of the request, it's created as not done. In fact, when the server returns a response, the value is explicitly set to { done: false }. For example, this is what I see in Postman: image

This successfully created a task in Marvin, but it's not marked as done: image

Feel free to close this if this is the intended behavior, e.g. no newly added task can be "done" from the start. Currently, this means that for my project I have to make two API calls, one to create the task, and another to mark it done immediately after.

Endpoint(s) in question /api/addTask To Reproduce: CURL request creating a new, done task:

curl --location 'https://serv.amazingmarvin.com/api/addTask' \
--header 'X-API-Token: your-marvin-api-key' \
--header 'Content-Type: application/json' \
--data '{
    "done": true,
    "day": "2024-01-21",
    "title": "This task should be marked done, but it'\''s not!"
}'

Make sure to replace "your-marvin-api-key" with your actual Marvin API key and to update the "day" to the current date

Expected behavior:

Thanks for looking at this ticket and thank you so much for making such a wonderful product! :D

mltucker commented 6 months ago

Hey, sorry I haven't looked at issues here in a while! I have just changed the server to allow creation of completed tasks. Give it a try! You won't get kudos or reward points, but the basic functionality should work.

thank you so much for making such a wonderful product! :) thanks for using Marvin

RogueArt commented 5 months ago

Thank you so much for taking a look at it and fixing it! I can confirm it works - it creates the task in a done/finished state with just the one createTask call. I can verify this is completed!