lyonk6 / PriusTask

Backend GoLang API for managing task lists!
0 stars 0 forks source link

`PostTaskTouch` route not updating `lastTouchType` property #1

Open bigjollygiant14 opened 3 years ago

bigjollygiant14 commented 3 years ago

When sending updates for a todo to PostTaskTouch, I'm getting 200 but lastTouchType is never updated and is instead returning an empty string.

I'm sending: { creationDate: 0 creationLatitude: 0 creationLongitude: 0 dueDate: 1618326000000 id: 112 lastTouchType: "" memo: "New Task Test 1" repeatIntervalInDays: 0 taskLength: 0 touchType: "DISMISSED" userId: -1 }

The response is the full todo list. { creationDate: 0 creationLatitude: 0 creationLongitude: 0 dueDate: 1618326000000 id: 112 lastTouchType: "" // Expect this to be "DISMISSED" memo: "New Task Test 1" repeatIntervalInDays: 0 taskLength: 0 userId: -1 }

lyonk6 commented 3 years ago

Can you confirm what API call is being made? I'm assuming this is a PostTask/ or PutTask/ but dismissing a task should only use PostTaskTouch/

bigjollygiant14 commented 3 years ago

I am hitting /PostTaskTouch for both DISMISS and COMPLETE

lyonk6 commented 3 years ago

I'm a bit confused. The task object you pasted above assigns lastTouchType="" and defines touchType="DISMISSED". Are you sure this is correct? touchType is not a task member.

bigjollygiant14 commented 3 years ago

I went off the documentation:

Any time a task is created, updated, deleted, completed, or dismissed an appropriate TaskTouch object should be sent to the API using the /PostTaskTouch method.

Valid task touch types include "UPDATED", "DELETED", "COMPLETED", "DISMISSED", "START_UP" and "CREATED".

I think the taskTouchType is the part of the object that's returned from the initial call.

So based on the way I read it, to update a task I need to hit /PostTaskTouch with touchType="DISMISSED" to change a task to dismissed. Is that correct?

lyonk6 commented 3 years ago

That's the intended usage. Any update made to a task gets a TaskTouch object too. But to save effort, if a task is just dismissed, completed, or deleted you don't need to update the task -- that information is just pulled from the TaskTouch object.

bigjollygiant14 commented 3 years ago

Ok, so to confirm, this is in fact a bug? Tried using that route with touchType="DISMISSED" and the task list returned is not updated.

lyonk6 commented 3 years ago

yeah still working in this